/* Base Reset & Variables */
:root {
    --bg-global: #FAF8F5;
    --brand-blue: #1B365D;
    --brand-red: #991B1B;
    --accent-gold: #D97706;
}

*, ::before, ::after {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: #e5e7eb;
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    margin: 0;
    line-height: 1.6;
    background-color: var(--bg-global);
    color: #1C1917;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

a {
    color: inherit;
    text-decoration: inherit;
}

h1, h2, h3, h4, h5, h6, p, blockquote, figure {
    margin: 0;
}

img, svg {
    display: block;
    vertical-align: middle;
    max-width: 100%;
    height: auto;
}

input, button, textarea, select {
    font: inherit;
}

/* Custom & Tailwind Utility Classes */
.hidden { display: none !important; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-grow { flex-grow: 1; }
.shrink-0 { flex-shrink: 0; }

.sticky { position: sticky; }
.top-0 { top: 0; }
.z-50 { z-index: 50; }
.relative { position: relative; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.h-16 { height: 4rem; }
.h-9 { height: 2.25rem; }
.h-7 { height: 1.75rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.w-12 { width: 3rem; }
.w-28 { width: 7rem; }
.h-auto { height: auto; }
.w-2 { width: 0.5rem; }
.h-2 { height: 0.5rem; }
.w-2.5 { width: 0.625rem; }
.h-2.5 { height: 0.625rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }

.max-w-\[1150px\] { max-width: 1150px; }
.max-w-\[420px\] { max-width: 420px; }
.max-w-xl { max-width: 36rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-0\.5 { padding: 0.125rem; }
.p-3 { padding: 0.75rem; }
.p-3\.5 { padding: 0.875rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pl-4 { padding-left: 1rem; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.pb-4 { padding-bottom: 1rem; }

.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-1\.5 { margin-top: 0.375rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-12 { margin-top: 3rem; }
.mb-4 { margin-bottom: 1rem; }

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-y-12 > * + * { margin-top: 3rem; }
.space-y-16 > * + * { margin-top: 4rem; }

.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-10 { gap: 2.5rem; }

.bg-white { background-color: #ffffff; }
.bg-stone-50 { background-color: #fafaf9; }
.bg-stone-100 { background-color: #f5f5f4; }
.bg-stone-100\/80 { background-color: rgba(245, 245, 244, 0.8); }
.bg-stone-900 { background-color: #1c1917; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-amber-50 { background-color: #fffbeb; }
.bg-amber-400 { background-color: #fbbf24; }

.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-l-2 { border-left-width: 2px; }

.border-stone-100 { border-color: #f5f5f4; }
.border-stone-200 { border-color: #e7e5e4; }
.border-stone-200\/80 { border-color: rgba(231, 229, 228, 0.8); }
.border-stone-800 { border-color: #292524; }
.border-blue-100 { border-color: #dbeafe; }
.border-amber-500\/60 { border-color: rgba(245, 158, 11, 0.6); }
.border-slate-700\/80 { border-color: rgba(51, 65, 85, 0.8); }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.text-white { color: #ffffff; }
.text-stone-200 { color: #e7e5e4; }
.text-stone-300 { color: #d6d3d1; }
.text-stone-400 { color: #a8a29e; }
.text-stone-500 { color: #78716c; }
.text-stone-600 { color: #57534e; }
.text-stone-700 { color: #44403c; }
.text-stone-800 { color: #292524; }
.text-stone-900 { color: #1c1917; }
.text-amber-300 { color: #fcd34d; }
.text-amber-900 { color: #78350f; }
.text-amber-600\/50 { color: rgba(217, 119, 6, 0.5); }

.leading-none { line-height: 1; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-widest { letter-spacing: 0.1em; }
.uppercase { text-transform: uppercase; }
.italic { font-style: italic; }
.text-center { text-align: center; }
.whitespace-nowrap { white-space: nowrap; }

.object-contain { object-fit: contain; }
.overflow-hidden { overflow: hidden; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.shadow-xs { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-sm { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.transition { transition-property: all; transition-duration: 200ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

/* Brand custom classes */
.brand-blue-bg { background-color: var(--brand-blue); }
.brand-blue-text { color: var(--brand-blue); }
.brand-red-text { color: var(--brand-red); }
.brand-red-bg { background-color: var(--brand-red); }

.btn-primary { background-color: var(--brand-blue); color: #ffffff; transition: all 0.2s ease; }
.btn-primary:hover { background-color: var(--accent-gold); }
.btn-ghost { border: 1px solid #D6D3D1; color: #1C1917; background-color: #FFFFFF; transition: all 0.2s ease; }
.btn-ghost:hover { border-color: var(--brand-blue); color: var(--brand-blue); background-color: #FAFAF9; }

.card-hover { transition: all 0.2s ease; box-shadow: 0 4px 12px rgba(28, 25, 23, 0.05); border: 1px solid #E7E5E4; }
.card-hover:hover { border-color: var(--brand-blue); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(28, 25, 23, 0.08); }

/* Responsive Grid & Utilities */
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .md\:col-span-4 { grid-column: span 4 / span 4; }
    .md\:col-span-5 { grid-column: span 5 / span 5; }
    .md\:col-span-7 { grid-column: span 7 / span 7; }
    .md\:col-span-8 { grid-column: span 8 / span 8; }
    .md\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
    .md\:text-base { font-size: 1rem; line-height: 1.5rem; }
    .md\:text-sm { font-size: 0.875rem; line-height: 1.25rem; }
    .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .md\:flex-row { flex-direction: row; }
    .md\:items-center { align-items: center; }
    .md\:items-end { align-items: flex-end; }
    .md\:text-right { text-align: right; }
    .md\:p-6 { padding: 1.5rem; }
    .md\:p-8 { padding: 2rem; }
    .md\:p-10 { padding: 2.5rem; }
    .md\:pt-0 { padding-top: 0; }
    .md\:w-auto { width: auto; }
    .md\:justify-end { justify-content: flex-end; }
    .md\:border-t-0 { border-top-width: 0; }
}

@media (min-width: 1024px) {
    .lg\:inline-flex { display: inline-flex; }
}

/* 手机端顶部导航布局修正 */
@media (max-width: 767px) {
    header {
        height: auto !important;
        min-height: 0 !important;
        align-items: stretch !important;
    }

    header > div {
        height: auto !important;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    /* 网站标题单独占一行 */
    header > div > div:first-child {
        width: 100%;
        flex: 1 1 100%;
        min-width: 0;
    }

    /* 标题和副标题更整齐 */
    header h1 {
        line-height: 1.3;
    }

    header h1 + span {
        line-height: 1.3;
    }

    /* 语言切换和联系按钮放到第二行 */
    header > div > div:last-child {
        width: 100%;
        height: 2.25rem !important;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    header > div > div:last-child > div {
        height: 2.25rem;
    }

    header > div > div:last-child > a:last-child {
        height: 2.25rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}
