/* ============================================================
   广东法牛律师事务所 · 全球法律服务平台
   共享设计系统 v2.0
   ============================================================ */

/* ----- Google Fonts (preconnect in HTML) ----- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Noto+Serif+SC:wght@400;600;700;900&display=swap');

/* ============================================================
   1. DESIGN TOKENS (CSS Custom Properties)
   ============================================================ */
:root {
    /* --- Brand Colors --- */
    --primary: #0d2137;
    --primary-light: #1a3f5c;
    --primary-lighter: #2c5f8a;
    --primary-dark: #081525;
    --primary-darker: #040d1a;
    --accent: #c8942e;
    --accent-light: #e8b94d;
    --accent-lighter: #f5d88a;
    --accent-dark: #a67820;
    --accent-darker: #7a5a18;

    /* --- Neutral Colors --- */
    --white: #ffffff;
    --bg: #f5f6f8;
    --bg-alt: #eef0f4;
    --bg-warm: #f8f7f4;
    --text: #1a1a2e;
    --text-light: #5a5a7a;
    --text-lighter: #8888a8;
    --text-muted: #b0b0c0;
    --border: #e2e4ea;
    --border-light: #f0f1f4;

    /* --- Functional Colors --- */
    --success: #27ae60;
    --error: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --wechat: #07c160;
    --bg-accent-subtle: #fdf6e8;
    --bg-chat: #f8f9fb;
    --accent-alpha-10: rgba(200,148,46,0.1);
    --accent-alpha-20: rgba(200,148,46,0.2);
    --white-alpha-10: rgba(255,255,255,0.1);
    --white-alpha-20: rgba(255,255,255,0.2);
    --dark-alpha-10: rgba(13,33,55,0.1);
    --dark-alpha-20: rgba(13,33,55,0.2);

    /* --- Gradients --- */
    --gradient-gold: linear-gradient(135deg, #c8942e, #e8b94d);
    --gradient-gold-reverse: linear-gradient(135deg, #e8b94d, #c8942e);
    --gradient-primary: linear-gradient(160deg, #0d2137 0%, #153250 30%, #1a3f5c 60%, #1a5276 100%);
    --gradient-primary-reverse: linear-gradient(160deg, #1a5276 0%, #1a3f5c 40%, #0d2137 100%);
    --gradient-cta: linear-gradient(135deg, #c8942e, #d4a43a, #e8b94d);
    --gradient-card: linear-gradient(135deg, var(--primary-light), var(--primary));
    --gradient-card-alt: linear-gradient(135deg, #1a3f5c, #2c5f8a);

    /* --- Typography --- */
    --font-cn: 'Noto Serif SC', 'Source Han Serif SC', 'STSong', 'SimSun', serif;
    --font-en: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-sans: var(--font-en);

    /* --- Shadows --- */
    --shadow-xs: 0 1px 4px rgba(13,33,55,0.04);
    --shadow-sm: 0 2px 8px rgba(13,33,55,0.05);
    --shadow: 0 4px 16px rgba(13,33,55,0.06);
    --shadow-md: 0 8px 24px rgba(13,33,55,0.08);
    --shadow-lg: 0 12px 40px rgba(13,33,55,0.10);
    --shadow-xl: 0 20px 60px rgba(13,33,55,0.14);
    --shadow-2xl: 0 30px 80px rgba(13,33,55,0.18);
    --shadow-gold: 0 4px 20px rgba(200,148,46,0.30);
    --shadow-gold-lg: 0 8px 40px rgba(200,148,46,0.35);

    /* --- Radii --- */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 50%;
    --radius-pill: 9999px;

    /* --- Spacing (8px base) --- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-14: 56px;
    --space-16: 64px;
    --space-20: 80px;
    --space-24: 96px;

    /* --- Transitions --- */
    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* --- Z-index --- */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-nav: 1000;
    --z-overlay: 2000;
    --z-modal: 3000;
    --z-toast: 5000;

    /* --- Securities Crime Tokens --- */
    --sec-bg: #0a0e1a;
    --sec-bg-alt: #0f1525;
    --sec-bg-card: #111827;
    --sec-text: #e2e8f0;
    --sec-text-secondary: #94a3b8;
    --sec-border: #2d3a50;
    --sec-blue: #3b82f6;
    --sec-red: #ef4444;
    --sec-green: #10b981;
    --sec-amber: #f59e0b;
    --sec-gradient: linear-gradient(160deg, #0a0e1a, #111827, #1a2744);
    --sec-gradient-accent: linear-gradient(135deg, #3b82f6, #2563eb);

    /* --- Container --- */
    --container-max: 1400px;
    --container-narrow: 960px;
    --container-padding: 24px;

    /* --- Color Scheme --- */
    color-scheme: light;
}

/* ============================================================
   1b. DARK MODE
   ============================================================ */
@media (prefers-color-scheme: dark) {
    :root { color-scheme: dark; }
}
[data-theme="dark"],
[data-theme="dark"] * {
    color-scheme: dark;
}

[data-theme="dark"]:root,
[data-theme="dark"]:root * {
    /* Invert primary palette for dark backgrounds */
    --primary: #1a3050;
    --primary-light: #2a4a70;
    --primary-lighter: #3a6090;
    --primary-dark: #0d2137;
    --primary-darker: #081525;

    /* Neutral colors inverted */
    --white: #1a1a2e;
    --bg: #12121f;
    --bg-alt: #1a1a30;
    --bg-warm: #1e1e32;
    --text: #e8e8f0;
    --text-light: #b0b0c8;
    --text-lighter: #8080a0;
    --text-muted: #606080;
    --border: #2a2a44;
    --border-light: #222238;

    /* Functional colors adjusted */
    --bg-accent-subtle: #2a2010;
    --bg-chat: #16162a;
    --accent-alpha-10: rgba(200,148,46,0.15);
    --accent-alpha-20: rgba(200,148,46,0.25);
    --white-alpha-10: rgba(255,255,255,0.05);
    --white-alpha-20: rgba(255,255,255,0.08);
    --dark-alpha-10: rgba(0,0,0,0.2);
    --dark-alpha-20: rgba(0,0,0,0.4);

    /* Shadows — more subtle on dark */
    --shadow-xs: 0 1px 4px rgba(0,0,0,0.2);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.25);
    --shadow: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.5);
    --shadow-2xl: 0 30px 80px rgba(0,0,0,0.6);
    --shadow-gold: 0 4px 20px rgba(200,148,46,0.20);
    --shadow-gold-lg: 0 8px 40px rgba(200,148,46,0.25);

    /* Gradient adjustments for dark backgrounds */
    --gradient-primary: linear-gradient(160deg, #0a1520 0%, #0d2137 30%, #1a3050 60%, #1a3f5c 100%);
    --gradient-primary-reverse: linear-gradient(160deg, #1a3f5c 0%, #0d2137 40%, #0a1520 100%);
    --gradient-card: linear-gradient(135deg, #1a3050, #0d2137);
    --gradient-card-alt: linear-gradient(135deg, #2a4a70, #1a3050);
}

/* Dark mode overrides for specific elements */
[data-theme="dark"] .card,
[data-theme="dark"] .blog-card,
[data-theme="dark"] .tool-card,
[data-theme="dark"] .lawyer-card,
[data-theme="dark"] .testimonial-card {
    background: #1a1a30;
    border-color: #2a2a44;
}
[data-theme="dark"] .header { background: rgba(18,18,31,0.95); }
[data-theme="dark"] .header.scrolled { background: rgba(18,18,31,0.98); }
[data-theme="dark"] .topbar { background: #0d1520; }
[data-theme="dark"] .footer { background: #0a1018; }
[data-theme="dark"] .footer-col a:not(.f-phone) { color: rgba(255,255,255,0.35); }
[data-theme="dark"] .page-hero { background: linear-gradient(160deg, #0a1520, #0d2137, #1a3050); }
[data-theme="dark"] .breadcrumb { background: #12121f; border-color: #2a2a44; }
[data-theme="dark"] .breadcrumb a { color: #8080a0; }
[data-theme="dark"] .section-alt { background: #12121f; }
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select { background: #1a1a30; border-color: #2a2a44; color: #e8e8f0; }
[data-theme="dark"] .chatbot-panel { background: #16162a; border-color: #2a2a44; }
[data-theme="dark"] .chat-msg.chat-bot { background: #1a1a30; }
[data-theme="dark"] .chat-msg.chat-user { background: #c8942e; color: #0d2137; }
[data-theme="dark"] .chatbot-header { background: #0d2137; }
[data-theme="dark"] .legal-topic-item { background: #1a1a30; }
[data-theme="dark"] .legal-topic-item:hover { background: #222240; }
[data-theme="dark"] .promo-bar { background: linear-gradient(135deg, #a67820, #c8942e); }
[data-theme="dark"] .promo-bar a { color: #0d2137; }

/* Dark mode toggle */
.dark-mode-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-pill);
    padding: 2px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1.6;
    vertical-align: middle;
}
.dark-mode-toggle:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent);
}

/* ============================================================
   1c. READING PROGRESS INDICATOR
   ============================================================ */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-gold);
    z-index: var(--z-toast);
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ============================================================
   1d. LAZY LOADING (images)
   ============================================================ */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.4s ease;
}
img[loading="lazy"].loaded,
img[loading="lazy"]:not([src=""]) {
    opacity: 1;
}

/* ============================================================
   1e. HIGH DPI / RETINA SUPPORT
   ============================================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .topbar,
    .header,
    .hero,
    .footer { image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges; }
}

/* ============================================================
   1f. PAGE TRANSITION ANIMATIONS
   ============================================================ */
@view-transition {
    navigation: auto;
}
/* Subtle fade for page transitions (progressive enhancement) */
::view-transition-old(root) {
    animation: 0.2s ease fadeOut;
}
::view-transition-new(root) {
    animation: 0.3s ease fadeIn;
}
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) { animation: none; }
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-en);
    color: var(--text);
    line-height: 1.65;
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }

/* Reduced motion: disable all animations for vestibular disorders */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal, .reveal.visible { opacity: 1 !important; transform: none !important; }
    .float-btn { animation: none !important; }
    .cta-phone { animation: none !important; }
    .typing-dot { animation: none !important; }
}
a:hover { color: var(--accent); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible,
.nav a:focus-visible,
.btn:focus-visible,
.faq-item:focus-visible,
.chatbot-toggle:focus-visible,
.chatbot-send:focus-visible,
.float-btn:focus-visible,
.mobile-menu:focus-visible,
.hero-tab:focus-visible,
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-cn); color: var(--primary); line-height: 1.25; }
.display-1 { font-size: 72px; font-weight: 900; line-height: 1.1; letter-spacing: -1px; }
.display-2 { font-size: 56px; font-weight: 900; line-height: 1.1; }
h1, .h1 { font-size: 48px; font-weight: 800; }
h2, .h2 { font-size: 36px; font-weight: 800; }
h3, .h3 { font-size: 28px; font-weight: 700; }
h4, .h4 { font-size: 22px; font-weight: 700; }
h5, .h5 { font-size: 18px; font-weight: 600; }
h6, .h6 { font-size: 16px; font-weight: 600; }
.body-lg { font-size: 18px; line-height: 1.7; }
.body-md { font-size: 16px; line-height: 1.65; }
.body-sm { font-size: 14px; line-height: 1.6; }
.body-xs { font-size: 12px; line-height: 1.5; }
.text-muted { color: var(--text-light); }
.text-accent { color: var(--accent); }
.text-center { text-align: center; }
.font-en { font-family: var(--font-en); }
.font-cn { font-family: var(--font-cn); }

@media (max-width: 768px) {
    .display-1 { font-size: 42px; }
    .display-2 { font-size: 36px; }
    h1, .h1 { font-size: 32px; }
    h2, .h2 { font-size: 26px; }
    h3, .h3 { font-size: 22px; }
    h4, .h4 { font-size: 18px; }
}

/* ============================================================
   4. LAYOUT
   ============================================================ */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}
.container-narrow {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}
.section { padding: var(--space-16) 0; }
.section-sm { padding: var(--space-10) 0; }
.section-lg { padding: var(--space-20) 0; }
.section-alt { background: var(--bg); }
.section-warm { background: var(--bg-warm); }
.section-dark { background: var(--primary); color: var(--white); }
.section-header { text-align: center; margin-bottom: var(--space-10); }
.section-header h2 {
    font-size: 36px;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: var(--space-2);
}
.section-header p {
    color: var(--text-light);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}
.section-header .divider {
    width: 60px;
    height: 4px;
    background: var(--gradient-gold);
    margin: var(--space-4) auto;
    border-radius: 2px;
}
.section-dark .section-header h2 { color: var(--white); }
.section-dark .section-header p { color: rgba(255,255,255,0.7); }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-5); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .section { padding: var(--space-10) 0; }
    .section-header h2 { font-size: 26px; }
}

/* ============================================================
   5. TOP BAR
   ============================================================ */
.topbar {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.topbar .container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.topbar a { color: var(--accent-light); font-weight: 600; font-size: 12px; }
.topbar a:hover { color: var(--white); }
.topbar .lang-links { display: flex; gap: 6px; }
.topbar .lang-links a {
    color: rgba(255,255,255,0.5);
    font-weight: 400;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all var(--transition);
}
.topbar .lang-links a:hover {
    color: var(--white);
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}
.topbar .lang-links a.active {
    color: var(--accent-light);
    border-color: var(--accent);
    background: rgba(200,148,46,0.1);
}

/* ============================================================
   6. HEADER / NAVIGATION
   ============================================================ */
.header {
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all var(--transition-slow);
    border-bottom: 1px solid transparent;
}
.header.scrolled {
    border-bottom-color: var(--border-light);
    background: rgba(255,255,255,0.98);
    box-shadow: 0 1px 8px rgba(13,33,55,0.06);
}
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 22px;
    font-weight: 900;
    font-family: var(--font-cn);
    position: relative;
    overflow: hidden;
}
.logo-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(200,148,46,0.15), transparent 60%);
}
.logo-text { line-height: 1.2; }
.logo-text strong {
    font-size: 18px;
    color: var(--primary);
    display: block;
    font-weight: 800;
    font-family: var(--font-cn);
}
.logo-text span {
    font-size: 10px;
    color: var(--text-lighter);
    display: block;
    letter-spacing: 0.5px;
}

/* Navigation */
.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius);
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
}
.nav a:not(.nav-phone):hover { color: var(--accent); background: #fdf6e8; }
.nav a.active { color: var(--accent); background: #fdf6e8; font-weight: 600; }
.nav a.nav-phone {
    background: var(--gradient-gold);
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: var(--radius-pill);
    margin-left: 6px;
}
.nav a.nav-phone:hover {
    background: var(--gradient-gold);
    color: var(--primary);
    transform: scale(1.03);
    box-shadow: var(--shadow-gold);
}

/* Mobile menu */
.mobile-menu {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--primary);
    padding: 4px;
    line-height: 1;
    z-index: calc(var(--z-nav) + 1);
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: calc(var(--z-nav) - 1);
    opacity: 0;
    transition: opacity var(--transition);
}
.mobile-overlay.active { opacity: 1; }

@media (max-width: 768px) {
    .nav {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 360px;
        height: 100vh;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 80px 24px 32px;
        box-shadow: var(--shadow-xl);
        gap: 4px;
        transition: right 0.3s ease;
        z-index: var(--z-nav);
        overflow-y: auto;
    }
    .nav.open {
        display: flex;
        right: 0;
    }
    .mobile-menu { display: block; }
    .mobile-overlay.active { display: block; }
    .nav a {
        font-size: 16px;
        padding: 12px 16px;
        border-radius: var(--radius);
        width: 100%;
    }
    .nav a.nav-phone {
        margin-left: 0;
        margin-top: 8px;
        justify-content: center;
        padding: 14px;
        font-size: 17px;
    }
}

/* ============================================================
   7. BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-gold {
    background: var(--gradient-gold);
    color: var(--primary);
}
.btn-gold:hover {
    box-shadow: var(--shadow-gold);
    color: var(--primary);
}
.btn-outline {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 2px 12px rgba(200,148,46,0.1);
}
.btn-outline-light {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.4);
}
.btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--white);
    color: var(--white);
}
.btn-white {
    background: var(--white);
    color: var(--primary);
}
.btn-white:hover { background: #f0f0f0; color: var(--primary); }
.btn-ghost {
    background: transparent;
    color: var(--primary-light);
    padding: 8px 16px;
}
.btn-ghost:hover { background: #fdf6e8; color: var(--accent); transform: none; }
.btn-sm { padding: 8px 20px; font-size: 13px; }
.btn-lg { padding: 16px 40px; font-size: 18px; }
.btn-block { width: 100%; }
.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-full);
    font-size: 20px;
}

/* ============================================================
   8. HERO SECTION
   ============================================================ */
.hero {
    background: var(--gradient-primary);
    color: var(--white);
    padding: var(--space-14) 0 var(--space-12);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -15%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(200,148,46,0.08) 0%, transparent 60%);
    border-radius: 50%;
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 50%);
    border-radius: 50%;
    pointer-events: none;
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}
.hero h1 {
    font-size: 44px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: var(--space-3);
    letter-spacing: 0.5px;
    font-family: var(--font-cn);
    color: var(--white);
}
.hero h1 .gold-text {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero .subtitle {
    font-size: 18px;
    opacity: 0.85;
    margin-bottom: var(--space-8);
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Hero tabs */
.hero-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 0;
}
.hero-tab {
    padding: 12px 32px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    position: relative;
    font-family: var(--font-en);
}
.hero-tab:first-child { border-radius: 12px 0 0 0; }
.hero-tab:last-child { border-radius: 0 12px 0 0; }
.hero-tab:hover { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85); }
.hero-tab.active { background: var(--white); color: var(--primary); }
.hero-tab .tab-icon { margin-right: 6px; }

/* Hero search box */
.hero-search-box {
    background: var(--white);
    border-radius: 0 16px 16px 16px;
    padding: var(--space-8) var(--space-8) var(--space-6);
    box-shadow: 0 12px 48px rgba(0,0,0,0.2);
}
.hero-browse-panel { display: none; }
.hero-browse-panel.active { display: block; }

.search-row {
    display: flex;
    gap: 12px;
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}
.search-input {
    flex: 1;
    min-width: 220px;
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: var(--font-en);
    transition: border-color var(--transition);
    color: var(--text);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(200,148,46,0.1);
}
.search-btn {
    padding: 14px 36px;
    background: var(--gradient-gold);
    color: var(--primary);
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    font-family: var(--font-en);
}
.search-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-gold); }

.search-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: var(--space-1);
}
.search-tag {
    padding: 5px 16px;
    background: var(--bg);
    border-radius: var(--radius-pill);
    font-size: 12px;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-en);
}
.search-tag:hover { background: #fdf6e8; color: var(--accent); }

/* Browse grid in hero */
.browse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: var(--space-2);
    margin-top: var(--space-4);
}
.browse-item {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 10px 14px;
    text-align: left;
    transition: all var(--transition);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}
.browse-item:hover { background: #fdf6e8; transform: translateX(3px); color: var(--text); }
.browse-item .bi-icon { font-size: 18px; flex-shrink: 0; }
.browse-item .bi-text { font-size: 13px; font-weight: 600; color: var(--primary); }

.hero-phone-line {
    text-align: center;
    margin-top: var(--space-4);
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}
.hero-phone-line a {
    color: var(--accent-light);
    font-size: 22px;
    font-weight: 800;
}
.hero-phone-line a:hover { color: var(--white); }

@media (max-width: 768px) {
    .hero { padding: var(--space-10) 0 var(--space-8); }
    .hero h1 { font-size: 28px; }
    .hero .subtitle { font-size: 14px; }
    .hero-search-box { padding: var(--space-5) var(--space-4) var(--space-4); }
    .search-row { flex-direction: column; }
    .search-btn { width: 100%; }
    .browse-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-tab { padding: 10px 18px; font-size: 13px; }
}

/* ============================================================
   9. TRUST / STATS BAR
   ============================================================ */
.trust-bar {
    background: var(--white);
    padding: var(--space-5) 0;
    border-bottom: 1px solid var(--border);
}
.trust-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-4);
    text-align: center;
}
.trust-item { padding: var(--space-1); }
.trust-item .num {
    font-size: 34px;
    font-weight: 900;
    color: var(--accent);
    display: block;
    line-height: 1.1;
    font-family: var(--font-en);
}
.trust-item .lbl {
    font-size: 12px;
    color: var(--text-lighter);
    margin-top: 2px;
}

@media (max-width: 1024px) { .trust-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
    .trust-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
    .trust-item .num { font-size: 26px; }
}

/* ============================================================
   10. TOPIC CARDS (Legal Topics Grid)
   ============================================================ */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-5);
}
.topic-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6) var(--space-5);
    transition: all var(--transition-slow);
    display: flex;
    gap: 16px;
    align-items: flex-start;
    text-decoration: none;
    color: var(--text);
    position: relative;
    overflow: hidden;
}
.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-gold);
    opacity: 0;
    transition: opacity var(--transition);
}
.topic-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent);
    color: var(--text);
}
.topic-card:hover::before { opacity: 1; }
.topic-card .t-icon { font-size: 36px; flex-shrink: 0; width: 48px; text-align: center; }
.topic-card .t-info { flex: 1; }
.topic-card h3 {
    font-size: 17px;
    color: var(--primary);
    margin-bottom: 6px;
    font-weight: 700;
    font-family: var(--font-cn);
}
.topic-card p {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 8px;
}
.topic-card .t-links { display: flex; flex-wrap: wrap; gap: 4px; }
.topic-card .t-links span {
    font-size: 11px;
    color: var(--text-lighter);
    background: var(--bg);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    transition: all var(--transition);
}
.topic-card:hover .t-links span {
    background: #fdf6e8;
    color: var(--accent);
}

/* ============================================================
   11. LAWYER SPOTLIGHT
   ============================================================ */
.lawyer-spotlight {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: var(--space-8);
    align-items: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    color: var(--white);
}
.lawyer-info h3 {
    font-size: 30px;
    font-weight: 900;
    margin-bottom: 6px;
    color: var(--white);
    font-family: var(--font-cn);
}
.lawyer-info .title {
    color: var(--accent-light);
    font-size: 17px;
    font-weight: 600;
    margin-bottom: var(--space-4);
}
.lawyer-info p {
    opacity: 0.85;
    margin-bottom: var(--space-3);
    font-size: 14px;
    line-height: 1.7;
}
.lawyer-cta {
    margin-top: var(--space-5);
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.lawyer-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}
.lstat { text-align: center; }
.lstat .ls-num {
    font-size: 36px;
    font-weight: 900;
    color: var(--accent-light);
    display: block;
    font-family: var(--font-en);
}
.lstat .ls-lbl {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .lawyer-spotlight { grid-template-columns: 1fr; padding: var(--space-6); gap: var(--space-5); }
}

/* ============================================================
   12. RESOURCE / TOOL CARDS
   ============================================================ */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-6);
}
.resource-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-slow);
    text-decoration: none;
    color: var(--text);
    display: block;
}
.resource-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
    color: var(--text);
    border-color: var(--accent);
}
.resource-card .rc-img {
    height: 160px;
    background: var(--gradient-card-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}
.resource-card .rc-body { padding: var(--space-5) var(--space-6); }
.resource-card h3 {
    font-size: 17px;
    color: var(--primary);
    margin-bottom: 6px;
    font-weight: 700;
    font-family: var(--font-cn);
}
.resource-card p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: var(--space-3);
    line-height: 1.5;
}
.resource-card .rc-link {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    transition: all var(--transition);
}
.resource-card:hover .rc-link { color: var(--primary); letter-spacing: 1px; }

/* ============================================================
   13. BLOG / ARTICLE CARDS
   ============================================================ */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-5);
}
.blog-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-slow);
    text-decoration: none;
    color: var(--text);
    display: block;
}
.blog-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
    color: var(--text);
}
.blog-card .bc-img {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}
.blog-card .bc-body { padding: var(--space-5) var(--space-5); }
.blog-card .bc-meta {
    font-size: 11px;
    color: var(--text-lighter);
    margin-bottom: 4px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.blog-card .bc-meta .bc-tag {
    background: var(--bg);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 10px;
}
.blog-card h3 {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 6px;
    font-weight: 700;
    font-family: var(--font-cn);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card p {
    font-size: 13px;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   14. TESTIMONIALS
   ============================================================ */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-5);
}
.testimonial-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: all var(--transition);
}
.testimonial-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
    transform: translateY(-2px);
}
.testimonial-card .stars { color: var(--accent); font-size: 16px; margin-bottom: var(--space-2); }
.testimonial-card blockquote {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: var(--space-3);
    font-style: italic;
    position: relative;
    padding-left: var(--space-4);
    border-left: 3px solid var(--accent-lighter);
}
.testimonial-card .author {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}
.testimonial-card .author span {
    font-weight: 400;
    color: var(--text-lighter);
    font-size: 12px;
}

/* ============================================================
   15. FAQ ACCORDION
   ============================================================ */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
    border-bottom: 1px solid var(--border);
    padding: var(--space-5) 0;
    cursor: pointer;
}
.faq-q {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    user-select: none;
}
.faq-q::after {
    content: '+';
    font-size: 22px;
    color: var(--accent);
    font-weight: 300;
    transition: transform var(--transition);
    flex-shrink: 0;
    line-height: 1;
}
.faq-item.open .faq-q::after {
    content: '−';
    transform: rotate(0deg);
}
.faq-a {
    font-size: 14px;
    color: var(--text-light);
    padding-top: var(--space-3);
    display: none;
    line-height: 1.7;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
}
.faq-item.open .faq-a {
    display: block;
    max-height: 600px;
}
.faq-a a { color: var(--accent); font-weight: 600; }

/* ============================================================
   16. GLOBAL REACH
   ============================================================ */
.global-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    text-align: center;
}
.global-card {
    padding: var(--space-6);
    background: var(--bg);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}
.global-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.global-card .g-icon { font-size: 36px; margin-bottom: var(--space-2); }
.global-card h4 {
    color: var(--primary);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}
.global-card p { font-size: 13px; color: var(--text-light); }

/* ============================================================
   17. CTA SECTION
   ============================================================ */
.cta-section {
    background: var(--gradient-cta);
    padding: var(--space-12) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 50%);
    border-radius: 50%;
    pointer-events: none;
}
.cta-section .container { position: relative; z-index: 1; }
.cta-section h2 {
    font-size: 34px;
    color: var(--primary);
    font-weight: 900;
    margin-bottom: 6px;
    font-family: var(--font-cn);
}
.cta-section p {
    font-size: 17px;
    color: var(--primary);
    opacity: 0.85;
    margin-bottom: var(--space-5);
}
.cta-phone {
    font-size: 48px;
    font-weight: 900;
    color: var(--primary);
    display: inline-block;
    margin-bottom: 4px;
    letter-spacing: 2px;
    text-decoration: none;
    transition: all var(--transition);
    animation: ctaPulse 2s infinite;
}
.cta-phone:hover { color: var(--primary-dark); transform: scale(1.02); }
@keyframes ctaPulse {
    0% { text-shadow: 0 0 0 rgba(13,33,55,0); }
    50% { text-shadow: 0 0 20px rgba(13,33,55,0.15); }
    100% { text-shadow: 0 0 0 rgba(13,33,55,0); }
}
.cta-sub-info {
    font-size: 13px;
    color: var(--primary);
    opacity: 0.7;
    margin-bottom: var(--space-5);
}

@media (max-width: 768px) {
    .cta-section h2 { font-size: 24px; }
    .cta-phone { font-size: 30px; }
}

/* ============================================================
   18. FOOTER
   ============================================================ */
.footer {
    background: var(--primary-darker);
    color: rgba(255,255,255,0.5);
    padding: var(--space-12) 0 var(--space-5);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}
.footer-col h4 {
    color: var(--white);
    font-size: 15px;
    margin-bottom: var(--space-4);
    font-weight: 700;
    font-family: var(--font-cn);
}
.footer-col a:not(.f-phone) {
    display: block;
    color: rgba(255,255,255,0.45);
    font-size: 13px;
    padding: 4px 0;
    transition: all var(--transition);
}
.footer-col a:not(.f-phone):hover {
    color: var(--accent-light);
    padding-left: 4px;
}
.footer-col .f-phone {
    color: var(--accent-light);
    font-size: 17px;
    font-weight: 700;
}
.footer-col span {
    font-size: 13px;
    padding: 4px 0;
    display: block;
    color: rgba(255,255,255,0.4);
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: var(--space-5);
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
}
.footer-bottom a { color: var(--accent-light); opacity: 0.6; }
.footer-bottom a:hover { opacity: 1; }

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
}

/* ============================================================
   19. FLOATING ACTION BUTTONS
   ============================================================ */
.float-actions {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: var(--z-overlay);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.float-btn {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    border: none;
    position: relative;
}
.float-btn:hover { transform: scale(1.12); }
.float-tel {
    background: var(--gradient-gold);
    color: var(--primary);
    animation: floatPulse 2s infinite;
}
@keyframes floatPulse {
    0% { box-shadow: 0 4px 16px rgba(200,148,46,0.4); }
    50% { box-shadow: 0 4px 28px rgba(200,148,46,0.7); }
    100% { box-shadow: 0 4px 16px rgba(200,148,46,0.4); }
}
.float-wx { background: #07c160; color: white; }
.float-top {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--border);
    font-size: 16px;
}
.float-label {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--text);
    background: var(--white);
    padding: 4px 12px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}
.float-btn:hover .float-label { opacity: 1; }

@media (max-width: 768px) {
    .float-actions { bottom: 16px; right: 16px; gap: 8px; }
    .float-btn { width: 48px; height: 48px; font-size: 20px; }
}

/* ============================================================
   20. AI CHATBOT
   ============================================================ */
.chatbot-toggle {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: var(--z-overlay);
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: var(--gradient-gold);
    color: var(--primary);
    border: none;
    cursor: pointer;
    font-size: 28px;
    box-shadow: 0 4px 20px rgba(200,148,46,0.4);
    transition: all var(--transition);
    animation: floatPulse 2s infinite;
}
.chatbot-toggle:hover { transform: scale(1.12); }

.chatbot-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: var(--z-modal);
    width: 380px;
    max-height: 560px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.chatbot-panel.open { display: flex; }

.chatbot-header {
    background: var(--gradient-primary);
    color: var(--white);
    padding: var(--space-4) var(--space-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chatbot-header h3 {
    font-size: 15px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    font-family: var(--font-en);
}
.chatbot-header h3 .badge {
    background: var(--accent);
    font-size: 10px;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    color: var(--primary);
}
.chatbot-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 24px;
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1;
}
.chatbot-close:hover { color: var(--white); }

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-5);
    background: #f8f9fb;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-height: 300px;
    max-height: 360px;
}
.chat-msg {
    max-width: 88%;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.6;
    animation: msgIn 0.3s ease;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-bot {
    background: #eef0f4;
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chat-user {
    background: var(--primary);
    color: var(--white);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chat-typing {
    display: flex;
    gap: 5px;
    padding: 14px 20px;
    background: #eef0f4;
    border-radius: var(--radius-md);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chat-typing span {
    width: 7px;
    height: 7px;
    background: var(--text-lighter);
    border-radius: var(--radius-full);
    animation: typing 1.4s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

.chatbot-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.chat-option {
    padding: 7px 14px;
    font-size: 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    color: var(--primary);
    font-weight: 500;
    transition: all var(--transition);
}
.chat-option:hover {
    background: #fdf6e8;
    border-color: var(--accent);
    color: var(--accent);
}

.chatbot-input {
    display: flex;
    padding: var(--space-3);
    border-top: 1px solid var(--border-light);
    background: var(--white);
    gap: 8px;
}
.chatbot-input input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 13px;
    outline: none;
    font-family: var(--font-en);
    transition: border-color var(--transition);
}
.chatbot-input input:focus { border-color: var(--accent); }
.chatbot-input button {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--gradient-gold);
    color: var(--primary);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}
.chatbot-input button:hover { transform: scale(1.05); }

.chatbot-footer {
    padding: 8px 16px;
    background: #f8f9fb;
    text-align: center;
    border-top: 1px solid var(--border-light);
}
.chatbot-footer a {
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 640px) {
    .chatbot-panel {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 80px;
        max-height: 500px;
    }
    .chatbot-toggle { bottom: 80px; right: 16px; }
}

/* ============================================================
   21. ANIMATIONS & SCROLL REVEAL
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* Animated counter numbers */
.counter-number {
    display: inline-block;
    transition: all 0.1s;
}

/* Smooth scroll offset for anchor links */
.scroll-offset {
    scroll-margin-top: 80px;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: var(--z-overlay);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--gradient-gold);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow-gold);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-slow);
    cursor: pointer;
    border: none;
}
.back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold-lg);
}
.back-to-top:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 3px;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ============================================================
   22. RESPONSIVE OVERRIDES
   ============================================================ */
@media (max-width: 1024px) {
    :root { --container-padding: 20px; }
}
@media (max-width: 768px) {
    :root { --container-padding: 16px; }
    .topic-grid { grid-template-columns: 1fr; }
    .resource-grid, .blog-grid, .testimonial-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .browse-grid { grid-template-columns: 1fr 1fr; }
}

/* Skip-to-content link (visually hidden until focused) */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    background: var(--primary);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: top var(--transition);
}
.skip-link:focus {
    top: 8px;
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ============================================================
   23. UTILITY CLASSES
   ============================================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}
.hidden { display: none !important; }
.visible { display: block !important; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* --- Extended spacing utilities --- */
.mt-1 { margin-top: var(--space-1); }
.mt-3 { margin-top: var(--space-3); }
.mt-5 { margin-top: var(--space-5); }
.mt-10 { margin-top: var(--space-10); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-10 { margin-bottom: var(--space-10); }
.mb-12 { margin-bottom: var(--space-12); }
.mb-16 { margin-bottom: var(--space-16); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mx-2 { margin-left: var(--space-2); margin-right: var(--space-2); }
.mx-4 { margin-left: var(--space-4); margin-right: var(--space-4); }
.my-2 { margin-top: var(--space-2); margin-bottom: var(--space-2); }
.my-4 { margin-top: var(--space-4); margin-bottom: var(--space-4); }
.my-8 { margin-top: var(--space-8); margin-bottom: var(--space-8); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-5 { padding: var(--space-5); }
.p-10 { padding: var(--space-10); }
.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }

/* --- Display & Layout utilities --- */
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-grid { display: grid; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-block { display: block; }
.d-none { display: none; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.w-full { width: 100%; }
.h-full { height: 100%; }
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* --- Text utilities --- */
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }
.text-uppercase { text-transform: uppercase; }
.text-capitalize { text-transform: capitalize; }
.text-underline { text-decoration: underline; }
.text-decoration-none { text-decoration: none; }
.text-nowrap { white-space: nowrap; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fw-300 { font-weight: 300; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fw-900 { font-weight: 900; }
.list-none { list-style: none; }
.cursor-pointer { cursor: pointer; }

/* ============================================================
   24. SKELETON SCREEN / LOADING PLACEHOLDERS
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg, #e8eaed 25%, #f0f2f5 37%, #e8eaed 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
    border-radius: var(--radius);
    color: transparent !important;
    user-select: none;
    pointer-events: none;
}
.skeleton-text { height: 1em; margin-bottom: 0.5em; width: 100%; }
.skeleton-text-sm { height: 0.75em; width: 60%; margin-bottom: 0.4em; }
.skeleton-text-lg { height: 1.5em; width: 80%; margin-bottom: 0.6em; }
.skeleton-title { height: 2em; width: 50%; margin-bottom: 0.8em; }
.skeleton-avatar { width: 60px; height: 60px; border-radius: 50%; }
.skeleton-thumb { width: 100%; padding-top: 56.25%; border-radius: var(--radius); } /* 16:9 ratio */
.skeleton-card {
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.skeleton-card .skeleton:not(.skeleton-card) {
    background: linear-gradient(90deg, #e0e3e8 25%, #eaecf0 37%, #e0e3e8 63%);
    background-size: 400% 100%;
}

@keyframes skeleton-loading {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton { animation: none; background: #e8eaed; }
}

/* ============================================================
   25. CONTAINER QUERIES (experimental)
   - Parent grids must declare container-type for children to adapt
   ============================================================ */

/* Enable container queries on reusable grid parents */
.topic-grid, .blog-grid, .tool-grid, .lawyer-grid, .testimonial-grid,
.footer-grid, .resource-grid, .feature-grid {
    container-type: inline-size;
}

/* Cards in narrow containers: stack vertically, reduce padding */
@container (max-width: 360px) {
    .card, .blog-card, .tool-card, .lawyer-card {
        padding: 12px;
    }
    .card h3, .blog-card h3, .tool-card h3 {
        font-size: 15px;
    }
    .card p, .blog-card p {
        font-size: 13px;
    }
}

/* Medium-width containers: compact 2-column support */
@container (min-width: 500px) and (max-width: 720px) {
    .card, .blog-card, .tool-card {
        padding: 16px;
    }
}

/* Wide containers: subtle size enhancement */
@container (min-width: 800px) {
    .card, .blog-card, .tool-card {
        padding: 24px;
    }
    .card h3, .blog-card h3 {
        font-size: 17px;
    }
}

/* ============================================================
   26. PRINT STYLES (enhanced)
   ============================================================ */
@media print {
    /* Hide interactive & non-essential elements */
    .header, .footer, .float-actions, .chatbot-toggle, .chatbot-panel,
    .mobile-menu, .mobile-overlay, .breadcrumb, .promo-bar,
    .cta-section, .hero-btns, .search-box, .hero-tabs,
    .back-to-top, .skip-link, .cookie-notice, .sticky-bar,
    .sidebar, .nav, .topbar, #mainNav,
    iframe, video, .no-print { display: none !important; }

    /* Page setup */
    @page { margin: 2cm 1.5cm; }
    * { background: transparent !important; box-shadow: none !important; text-shadow: none !important; }

    /* Body typography for print */
    body {
        font-size: 12pt;
        line-height: 1.6;
        color: #000;
        background: #fff;
        font-family: 'Noto Serif SC', 'SimSun', 'STSong', serif;
    }

    /* Headings */
    h1, h2, h3, h4 { page-break-after: avoid; color: #000; }
    h1 { font-size: 22pt; }
    h2 { font-size: 16pt; }
    h3 { font-size: 13pt; }

    /* Links: show URL */
    a { color: #000; text-decoration: underline; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
    a[href^="/"]::after { content: " (https://faniulaw.cn" attr(href) ")"; font-size: 9pt; color: #555; }
    a[href^="#"]::after { content: ""; }
    a[href^="tel:"]::after { content: ""; }

    /* Images */
    img { max-width: 100% !important; page-break-inside: avoid; }

    /* Tables */
    table { font-size: 10pt; border-collapse: collapse; }
    th, td { border: 1px solid #ccc; padding: 4px 8px; }

    /* Avoid page breaks inside key elements */
    .card, .faq-item, .section, article, .blog-card,
    .lawyer-card, .tool-card, .testimonial-card {
        page-break-inside: avoid;
    }

    /* Show main content at full width */
    .container, .main, #main-content, main {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* ===== MOBILE STICKY BOTTOM BAR (Phone CTA) ===== */
.sticky-phone-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(135deg, #0d2137 0%, #1a3350 100%);
    border-top: 2px solid #c8942e;
    padding: 8px 16px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    font-family: 'Inter', 'Noto Serif SC', sans-serif;
}
.sticky-phone-bar .bar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    max-width: 1400px;
    margin: 0 auto;
}
.sticky-phone-bar .bar-phone {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}
.sticky-phone-bar .bar-phone .phone-icon {
    width: 36px;
    height: 36px;
    background: #c8942e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    animation: phonePulse 2s infinite;
    flex-shrink: 0;
}
.sticky-phone-bar .bar-phone .phone-number {
    color: #c8942e;
    letter-spacing: 1px;
}
.sticky-phone-bar .bar-cta {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.sticky-phone-bar .bar-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}
.sticky-phone-bar .bar-btn-call {
    background: #c8942e;
    color: #0d2137;
}
.sticky-phone-bar .bar-btn-call:hover {
    background: #d4a33e;
    transform: translateY(-1px);
}
.sticky-phone-bar .bar-btn-consult {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}
.sticky-phone-bar .bar-btn-consult:hover {
    border-color: #c8942e;
    color: #c8942e;
}
@media (max-width: 768px) {
    .sticky-phone-bar { display: block; }
    body { padding-bottom: 64px; }
}
@keyframes phonePulse {
    0% { box-shadow: 0 0 0 0 rgba(200, 148, 46, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(200, 148, 46, 0); }
    100% { box-shadow: 0 0 0 0 rgba(200, 148, 46, 0); }
}
.address-block {
    background: #f8f6f0;
    border-left: 3px solid #c8942e;
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin: 20px 0;
    font-size: 15px;
    line-height: 1.8;
}
.address-block strong { color: #0d2137; }
.address-block .addr-phone {
    color: #c8942e;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

/* ============================================================
   28. DESKTOP STICKY CALL BAR (scroll-triggered)
   ============================================================ */
.desktop-call-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: rgba(13,33,55,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 2px solid #c8942e;
    padding: 10px 24px;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.3);
    font-family: 'Inter', 'Noto Serif SC', sans-serif;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.desktop-call-bar.dcb-visible { transform: translateY(0); }
.desktop-call-bar .dcb-container {
    max-width: 1400px; margin: 0 auto;
    display: flex; align-items: center;
    justify-content: space-between; gap: 16px;
}
.desktop-call-bar .dcb-brand {
    display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.desktop-call-bar .dcb-brand .dcb-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, #c8942e, #e8b94d);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.desktop-call-bar .dcb-brand .dcb-name { color: #fff; font-size: 14px; font-weight: 700; }
.desktop-call-bar .dcb-brand .dcb-tag {
    padding: 2px 8px; border-radius: 4px;
    background: rgba(200,148,46,0.15);
    color: #c8942e; font-size: 11px; font-weight: 600; margin-left: 6px;
}
.desktop-call-bar .dcb-phone-wrap { display: flex; align-items: center; gap: 12px; }
.desktop-call-bar .dcb-phone-link {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; transition: transform 0.2s;
}
.desktop-call-bar .dcb-phone-link:hover { transform: scale(1.05); }
.desktop-call-bar .dcb-phone-link .dcb-phone-num {
    font-size: 24px; font-weight: 900;
    color: #c8942e; letter-spacing: 2px;
}
.desktop-call-bar .dcb-phone-link .dcb-phone-icon { font-size: 22px; }
.desktop-call-bar .dcb-actions { display: flex; gap: 8px; flex-shrink: 0; }
.desktop-call-bar .dcb-btn {
    padding: 8px 18px; border-radius: 6px;
    font-size: 13px; font-weight: 600;
    text-decoration: none; transition: all 0.3s; white-space: nowrap;
}
.desktop-call-bar .dcb-btn-call {
    background: linear-gradient(135deg, #c8942e, #e8b94d);
    color: #0d2137;
}
.desktop-call-bar .dcb-btn-call:hover {
    background: linear-gradient(135deg, #d4a33e, #f0c55e);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(200,148,46,0.4);
}
.desktop-call-bar .dcb-btn-consult {
    background: transparent; color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
}
.desktop-call-bar .dcb-btn-consult:hover { border-color: #c8942e; color: #c8942e; }
.desktop-call-bar .dcb-close {
    background: none; border: none;
    color: rgba(255,255,255,0.3); font-size: 18px;
    cursor: pointer; padding: 4px 8px;
    transition: color 0.2s; flex-shrink: 0;
}
.desktop-call-bar .dcb-close:hover { color: #fff; }

/* SEC dark theme override */
.sec-page .desktop-call-bar {
    border-top-color: #3b82f6;
    background: rgba(10,14,26,0.95);
}
.sec-page .desktop-call-bar .dcb-phone-num { color: #93c5fd; }
.sec-page .desktop-call-bar .dcb-tag { background: rgba(59,130,246,0.15); color: #93c5fd; }
.sec-page .desktop-call-bar .dcb-btn-call {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

@media (min-width: 769px) {
    .desktop-call-bar.dcb-visible { display: block !important; }
}
@media (max-width: 768px) {
    .desktop-call-bar { display: none !important; }
}
