        :root {
            --primary: #5B5FEF;
            --primary-light: #8184F4;
            --primary-soft: rgba(91, 95, 239, 0.08);
            --primary-dark: #4346c4;
            --success: #10b981;
            --text-primary: #1a1a2e;

            --primary-glow: rgba(91, 95, 239, 0.2);
            --bg: #f7f8fc;
            --bg-alt: #eef0f7;
            --card-bg: #ffffff;
            --card-border: rgba(0, 0, 0, 0.06);
            --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
            --card-hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
            --text: #1a1a2e;
            --text-secondary: #5a5d72;
            --text-muted: #9497aa;
            --glass: rgba(255, 255, 255, 0.85);
            --accent: #10b981;
            --accent-soft: rgba(16, 185, 129, 0.1);
            --divider: rgba(0, 0, 0, 0.06);
            --tag-bg: #f0f1f8;
            --tag-text: #5a5d72;
            --tag-active-bg: var(--primary);
            --tag-active-text: #ffffff;
            --input-bg: #f0f1f8;
            --input-focus-bg: #ffffff;
            --input-border: transparent;
            --input-focus-border: var(--primary);
        }

        [data-theme="dark"] {
            --bg: #0f0f1a;
            --bg-alt: #161625;
            --card-bg: #1a1a2e;
            --card-border: rgba(255, 255, 255, 0.06);
            --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
            --card-hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
            --text: #e8e8f0;
            --text-secondary: #a0a3b8;
            --text-muted: #6b6e82;
            --glass: rgba(22, 22, 37, 0.9);
            --primary-soft: rgba(129, 132, 244, 0.1);
            --divider: rgba(255, 255, 255, 0.06);
            --tag-bg: #22223a;
            --tag-text: #a0a3b8;
            --tag-active-bg: var(--primary);
            --tag-active-text: #ffffff;
            --input-bg: #22223a;
            --input-focus-bg: #2a2a42;
            --input-border: transparent;
            --input-focus-border: var(--primary-light);
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: 'Inter', 'PingFang SC', 'SF Pro Text', -apple-system, system-ui, sans-serif;
            background: var(--bg);
            color: var(--text);
            line-height: 1.6;
            transition: background 0.3s ease, color 0.3s ease;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            min-height: 100vh;
        }

        /* ─── Header ─── */
        header {
            position: sticky;
            top: 0;
            z-index: 1000;
            background: var(--glass);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            border-bottom: 1px solid var(--divider);
            padding: 20px 16px 16px;
            transition: background 0.3s ease, border-color 0.3s ease;
        }

        .header-inner {
            max-width: 960px;
            margin: 0 auto;
        }

        /* ─── Page Switcher ─── */
        .page-switcher {
            display: flex;
            justify-content: center;
            gap: 8px;
            margin-bottom: 20px;
        }

        .page-tab {
            flex: 0 1 220px;
            padding: 14px 28px;
            border-radius: 16px;
            border: 2px solid transparent;
            background: var(--tag-bg);
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 15px;
            font-weight: 600;
            text-align: center;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            letter-spacing: 0.5px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        .page-tab .tab-subtitle {
            font-size: 11px;
            font-weight: 400;
            opacity: 0.7;
            letter-spacing: 0;
        }

        .page-tab:hover {
            background: var(--primary-soft);
            color: var(--primary);
            border-color: var(--primary-glow);
            transform: translateY(-1px);
        }

        .page-tab.active {
            background: var(--primary);
            color: #ffffff;
            border-color: var(--primary);
            box-shadow: 0 8px 24px var(--primary-glow);
            transform: translateY(-2px);
        }

        .page-tab.active .tab-subtitle {
            color: rgba(255, 255, 255, 0.85);
        }

        /* ─── Search ─── */
        .search-wrap {
            position: relative;
            margin-bottom: 14px;
        }

        .search-wrap .search-icon {
            position: absolute;
            left: 16px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 16px;
            color: var(--text-muted);
            pointer-events: none;
        }

        #searchInput {
            width: 100%;
            padding: 14px 16px 14px 44px;
            border-radius: 14px;
            border: 2px solid var(--input-border);
            background: var(--input-bg);
            color: var(--text);
            font-size: 15px;
            outline: none;
            transition: all 0.3s ease;
            font-family: inherit;
        }

        #searchInput:focus {
            background: var(--input-focus-bg);
            border-color: var(--input-focus-border);
            box-shadow: 0 0 0 4px var(--primary-soft);
        }

        #searchInput::placeholder {
            color: var(--text-muted);
        }

        /* ─── Stats Bar ─── */
        .stats-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
            flex-wrap: wrap;
            gap: 8px;
        }

        .word-count {
            font-size: 13px;
            color: var(--text-muted);
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .word-count .count-num {
            color: var(--primary);
            font-weight: 700;
            font-size: 16px;
        }

        .clear-search {
            display: none;
            font-size: 12px;
            color: var(--primary);
            cursor: pointer;
            background: var(--primary-soft);
            border: none;
            padding: 6px 12px;
            border-radius: 8px;
            font-weight: 500;
            transition: 0.2s;
            font-family: inherit;
        }

        .clear-search:hover {
            background: var(--primary);
            color: #fff;
        }

        .clear-search.visible {
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        /* ─── Categories ─── */
        .categories-wrapper {
            position: relative;
            display: flex;
            align-items: center;
            margin: 0 -4px;
        }

        .categories {
            display: flex;
            overflow-x: auto;
            gap: 8px;
            padding: 4px 0 4px 4px;
            scrollbar-width: none;
            flex-wrap: nowrap;
            scroll-behavior: smooth;
            flex: 1;
        }

        .categories::-webkit-scrollbar {
            display: none;
        }

        .cat-scroll-btn {
            flex-shrink: 0;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: 1.5px solid var(--card-border);
            background: var(--card-bg);
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.25s ease;
            box-shadow: var(--card-shadow);
            z-index: 10;
            opacity: 0;
            pointer-events: none;
        }

        .cat-scroll-btn.visible {
            opacity: 1;
            pointer-events: auto;
        }

        .cat-scroll-btn:hover {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary);
            box-shadow: 0 4px 12px var(--primary-glow);
        }

        .cat-scroll-btn:active {
            transform: scale(0.92);
        }

        .cat-scroll-btn-left {
            margin-right: 4px;
        }

        .cat-scroll-btn-right {
            margin-left: 4px;
        }

        @media (max-width: 768px) {
            .cat-scroll-btn {
                width: 28px;
                height: 28px;
                font-size: 12px;
            }

            .categories-wrapper {
                margin: 0 -2px;
            }
        }

        @media (max-width: 480px) {
            .cat-scroll-btn {
                width: 26px;
                height: 26px;
                font-size: 11px;
            }
        }

        .cat-btn {
            white-space: nowrap;
            padding: 8px 16px;
            border-radius: 20px;
            border: 1.5px solid transparent;
            background: var(--tag-bg);
            color: var(--tag-text);
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.25s ease;
            font-family: inherit;
            flex-shrink: 0;
        }

        .cat-btn:hover {
            background: var(--primary-soft);
            color: var(--primary);
            border-color: var(--primary-glow);
        }

        .cat-btn.active {
            background: var(--tag-active-bg);
            color: var(--tag-active-text);
            border-color: var(--primary);
            box-shadow: 0 2px 8px var(--primary-glow);
            font-weight: 600;
        }

        /* ─── Main Container ─── */
        .container {
            width: 100%;
            max-width: 960px;
            margin: 24px auto;
            padding: 0 16px 100px;
        }

        .no-results {
            text-align: center;
            padding: 60px 20px;
            color: var(--text-muted);
            font-size: 15px;
        }

        .no-results .no-icon {
            font-size: 48px;
            margin-bottom: 16px;
            display: block;
        }

        /* ─── Word Grid ─── */
        .word-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 14px;
            width: 100%;
        }

        .word-card {
            background: var(--card-bg);
            padding: 22px 14px 18px;
            border-radius: 16px;
            text-align: center;
            border: 1px solid var(--card-border);
            box-shadow: var(--card-shadow);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            animation: cardIn 0.4s ease backwards;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            min-height: 100px;
            width: 100%;
            position: relative;
            overflow: hidden;
        }

        .word-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(135deg, var(--primary), var(--primary-light));
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .word-card:hover {
            transform: translateY(-4px);
            box-shadow: var(--card-hover-shadow);
            border-color: var(--primary-glow);
        }

        .word-card:hover::before {
            opacity: 1;
        }

        .word-card:active {
            transform: scale(0.97);
        }

        .word-card .main-word {
            font-weight: 700;
            font-size: 1.25em;
            color: var(--text);
            margin-bottom: 2px;
            letter-spacing: 0.3px;
            word-break: break-word;
            width: 100%;
            transition: color 0.3s ease;
        }

        .word-card:hover .main-word {
            color: var(--primary);
        }

        .word-card .phonetic {
            font-size: 0.78em;
            color: var(--text-muted);
            font-family: 'Segoe UI', 'SF Pro Text', sans-serif;
            margin-bottom: 10px;
            letter-spacing: 0.2px;
        }

        .word-card .chi {
            font-size: 0.88em;
            color: var(--text-secondary);
            font-weight: 500;
            border-top: 1px dashed var(--divider);
            width: 100%;
            padding-top: 8px;
            margin-top: 4px;
            transition: color 0.3s ease;
        }

        .word-card:hover .chi {
            color: var(--text);
        }

        .word-card .speak-hint {
            position: absolute;
            bottom: 8px;
            right: 10px;
            font-size: 12px;
            opacity: 0;
            transition: opacity 0.3s ease;
            color: var(--primary);
        }

        .word-card:hover .speak-hint {
            opacity: 0.6;
        }

        @keyframes cardIn {
            from {
                opacity: 0;
                transform: translateY(16px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* ─── FAB Buttons ─── */
        .fab {
            position: fixed;
            bottom: 28px;
            right: 28px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            z-index: 500;
        }

        .btn-round {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: var(--card-bg);
            color: var(--text);
            border: 1px solid var(--card-border);
            box-shadow: var(--card-shadow);
            cursor: pointer;
            font-size: 20px;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(10px);
        }

        .btn-round:hover {
            transform: translateY(-2px);
            box-shadow: var(--card-hover-shadow);
            background: var(--primary);
            color: #fff;
            border-color: var(--primary);
        }

        .btn-round.chat-btn {
            font-size: 22px;
        }

        /* ─── Chat Panel ─── */
        .chat-panel {
            position: fixed;
            bottom: 90px;
            right: 28px;
            width: 380px;
            height: 520px;
            background: var(--card-bg);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
            border: 1px solid var(--card-border);
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            z-index: 2000;
            transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
            transform: translateY(20px) scale(0.95);
            opacity: 0;
            pointer-events: none;
        }

        .chat-panel.active {
            transform: translateY(0) scale(1);
            opacity: 1;
            pointer-events: auto;
        }

        .chat-header {
            padding: 16px 18px;
            background: var(--primary);
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: 600;
        }

        .chat-header h3 {
            margin: 0;
            font-size: 15px;
            font-weight: 600;
        }

        .chat-close {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            font-size: 20px;
            cursor: pointer;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: 0.2s;
        }

        .chat-close:hover {
            background: rgba(255, 255, 255, 0.35);
        }

        .chat-body {
            flex: 1;
            padding: 16px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .chat-message {
            padding: 10px 14px;
            border-radius: 14px;
            max-width: 88%;
            font-size: 13.5px;
            line-height: 1.55;
            word-break: break-word;
        }

        .chat-message.system {
            background: var(--tag-bg);
            color: var(--text-muted);
            align-self: center;
            text-align: center;
            font-size: 12px;
            border-radius: 10px;
            max-width: 95%;
        }

        .chat-message.user {
            background: var(--primary);
            color: white;
            align-self: flex-end;
            border-bottom-right-radius: 6px;
        }

        .chat-message.ai {
            background: var(--bg-alt);
            color: var(--text);
            align-self: flex-start;
            border-bottom-left-radius: 6px;
            white-space: pre-wrap;
        }

        .chat-footer {
            padding: 12px 14px;
            display: flex;
            gap: 8px;
            border-top: 1px solid var(--divider);
            background: var(--card-bg);
        }

        #chatInput {
            flex: 1;
            padding: 10px 14px;
            border-radius: 12px;
            border: 1.5px solid var(--card-border);
            background: var(--bg-alt);
            color: var(--text);
            outline: none;
            font-family: inherit;
            font-size: 14px;
            transition: 0.3s;
        }

        #chatInput:focus {
            border-color: var(--primary);
        }

        #sendBtn {
            padding: 0 18px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 12px;
            cursor: pointer;
            font-weight: 600;
            font-size: 14px;
            font-family: inherit;
            transition: 0.3s;
        }

        #sendBtn:hover {
            background: var(--primary-light);
        }

        #sendBtn:active {
            transform: scale(0.96);
        }

        /* ─── Responsive ─── */
        @media (max-width: 768px) {
            header {
                padding: 14px 12px 12px;
            }

            .page-tab {
                flex: 0 1 160px;
                padding: 12px 18px;
                font-size: 14px;
            }

            .page-tab .tab-subtitle {
                font-size: 10px;
            }

            .word-grid {
                grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
                gap: 10px;
            }

            .word-card {
                padding: 18px 10px 14px;
                min-height: 85px;
                border-radius: 14px;
            }

            .word-card .main-word {
                font-size: 1.1em;
            }

            .container {
                padding: 0 12px 90px;
                margin-top: 16px;
            }

            .chat-panel {
                top: 0;
                bottom: 0;
                left: 0;
                right: 0;
                width: 100%;
                height: 100%;
                border-radius: 0;
                margin: 0;
            }

            .fab {
                bottom: 20px;
                right: 20px;
                gap: 10px;
            }

            .btn-round {
                width: 44px;
                height: 44px;
                font-size: 18px;
            }
        }

        @media (max-width: 480px) {
            .word-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 8px;
            }

            .word-card {
                padding: 16px 8px 12px;
                min-height: 78px;
                border-radius: 12px;
            }

            .word-card .main-word {
                font-size: 1.05em;
            }

            .word-card .phonetic {
                font-size: 0.72em;
            }

            .word-card .chi {
                font-size: 0.8em;
            }

            .cat-btn {
                padding: 6px 13px;
                font-size: 12px;
            }

            .page-tab {
                flex: 0 1 140px;
                padding: 10px 14px;
                font-size: 13px;
            }
        }

        /* ─── 2026 responsive app layout ─── */
        :root {
            --primary: #5b5bd6;
            --primary-light: #7373e6;
            --primary-dark: #4747b8;
            --primary-soft: rgba(91, 91, 214, 0.10);
            --primary-glow: rgba(91, 91, 214, 0.20);
            --accent: #2e9d78;
            --accent-soft: rgba(46, 157, 120, 0.11);
            --bg: #f6f7fb;
            --bg-alt: #eef0f6;
            --card-border: rgba(23, 26, 43, 0.08);
            --text: #171a2b;
            --text-secondary: #5c6073;
            --text-muted: #8b8fa1;
            --glass: rgba(246, 247, 251, 0.92);
            --page-gutter: clamp(16px, 3vw, 32px);
            --content-width: 1240px;
        }

        [data-theme="dark"] {
            --bg: #11131d;
            --bg-alt: #181b28;
            --card-bg: #1a1d2b;
            --card-border: rgba(255, 255, 255, 0.08);
            --text: #f1f2f7;
            --text-secondary: #afb2c1;
            --text-muted: #7f8397;
            --glass: rgba(17, 19, 29, 0.92);
            --tag-bg: #202332;
            --input-bg: #1c1f2d;
            --input-focus-bg: #202332;
        }

        body {
            background-image:
                radial-gradient(circle at 12% -8%, var(--primary-soft), transparent 34rem),
                linear-gradient(180deg, var(--bg), var(--bg));
        }

        button,
        input {
            -webkit-tap-highlight-color: transparent;
        }

        button:focus-visible,
        input:focus-visible {
            outline: 3px solid var(--primary-glow);
            outline-offset: 2px;
        }

        header {
            padding: 12px var(--page-gutter);
            background: var(--glass);
        }

        .header-inner {
            max-width: var(--content-width);
            display: grid;
            grid-template-columns: 190px minmax(270px, 330px) minmax(260px, 1fr) auto;
            align-items: center;
            gap: 16px;
        }

        .brand {
            min-width: 0;
        }

        .brand-kicker {
            display: block;
            margin-bottom: 2px;
            color: var(--primary);
            font-size: 11px;
            font-weight: 750;
            letter-spacing: 0.12em;
            text-transform: uppercase;
        }

        .brand-title {
            color: var(--text);
            font-size: 17px;
            font-weight: 750;
            letter-spacing: -0.02em;
            line-height: 1.2;
            white-space: nowrap;
        }

        .page-switcher {
            justify-content: stretch;
            gap: 4px;
            margin: 0;
            padding: 4px;
            border: 1px solid var(--card-border);
            border-radius: 14px;
            background: var(--tag-bg);
        }

        .page-tab {
            flex: 1 1 0;
            min-height: 46px;
            padding: 7px 12px;
            border: 0;
            border-radius: 10px;
            background: transparent;
            font-size: 13px;
            letter-spacing: 0;
            line-height: 1.2;
            transform: none;
        }

        .page-tab:hover {
            border-color: transparent;
            transform: none;
        }

        .page-tab.active {
            background: var(--card-bg);
            color: var(--primary);
            border-color: transparent;
            box-shadow: 0 2px 10px rgba(23, 26, 43, 0.08);
            transform: none;
        }

        [data-theme="dark"] .page-tab.active {
            background: #292c3d;
            color: #a9a9ff;
        }

        .page-tab.active .tab-subtitle {
            color: var(--text-muted);
        }

        .search-wrap {
            margin: 0;
        }

        #searchInput {
            min-height: 48px;
            padding-right: 98px;
            border: 1px solid var(--card-border);
            background: var(--card-bg);
            box-shadow: 0 1px 2px rgba(23, 26, 43, 0.03);
        }

        #searchInput::-webkit-search-cancel-button {
            display: none;
            -webkit-appearance: none;
        }

        .clear-search {
            position: absolute;
            top: 50%;
            right: 8px;
            min-height: 32px;
            padding: 6px 10px;
            transform: translateY(-50%);
        }

        .header-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .icon-btn,
        .ai-entry,
        .filter-trigger {
            min-height: 44px;
            border: 1px solid var(--card-border);
            border-radius: 12px;
            background: var(--card-bg);
            color: var(--text);
            cursor: pointer;
            font-family: inherit;
            font-weight: 650;
            transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
        }

        .icon-btn {
            width: 44px;
            padding: 0;
            font-size: 18px;
        }

        .ai-entry {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 0 14px;
            border-color: var(--primary);
            background: var(--primary);
            color: #fff;
        }

        .icon-btn:hover,
        .filter-trigger:hover {
            border-color: var(--primary-glow);
            background: var(--primary-soft);
            color: var(--primary);
        }

        .ai-entry:hover {
            background: var(--primary-dark);
            transform: translateY(-1px);
        }

        .container {
            max-width: var(--content-width);
            margin: 26px auto 0;
            padding: 0 var(--page-gutter) 112px;
            display: grid;
            grid-template-columns: 220px minmax(0, 1fr);
            align-items: start;
            gap: 28px;
        }

        .filter-panel {
            position: sticky;
            top: 86px;
            max-height: calc(100vh - 108px);
            padding: 18px 12px 14px;
            overflow: hidden;
            border: 1px solid var(--card-border);
            border-radius: 18px;
            background: var(--card-bg);
            box-shadow: 0 8px 30px rgba(23, 26, 43, 0.05);
        }

        .filter-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 6px 12px;
        }

        .filter-panel-title {
            font-size: 14px;
            font-weight: 750;
            letter-spacing: 0.01em;
        }

        .filter-close {
            display: none;
        }

        .categories-wrapper {
            display: block;
            margin: 0;
        }

        .categories {
            display: flex;
            flex-direction: column;
            gap: 4px;
            max-height: calc(100vh - 165px);
            padding: 0 2px 2px;
            overflow-x: hidden;
            overflow-y: auto;
            scrollbar-width: thin;
        }

        .cat-scroll-btn {
            display: none !important;
        }

        .cat-btn {
            width: 100%;
            min-height: 40px;
            padding: 9px 10px;
            border: 0;
            border-radius: 10px;
            text-align: left;
            white-space: normal;
            line-height: 1.35;
        }

        .cat-btn:hover {
            border-color: transparent;
        }

        .cat-btn.active {
            position: relative;
            padding-left: 14px;
            background: var(--primary-soft);
            color: var(--primary);
            border-color: transparent;
            box-shadow: none;
        }

        .cat-btn.active::before {
            content: '';
            position: absolute;
            left: 4px;
            top: 11px;
            bottom: 11px;
            width: 3px;
            border-radius: 99px;
            background: var(--primary);
        }

        .word-content {
            min-width: 0;
        }

        .results-header {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 16px;
        }

        .results-eyebrow {
            display: block;
            margin-bottom: 3px;
            color: var(--primary);
            font-size: 12px;
            font-weight: 750;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }

        .results-title {
            font-size: clamp(22px, 2.2vw, 30px);
            font-weight: 780;
            letter-spacing: -0.035em;
            line-height: 1.2;
        }

        .results-tools {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .word-count {
            min-height: 38px;
            padding: 7px 11px;
            border: 1px solid var(--card-border);
            border-radius: 10px;
            background: var(--card-bg);
        }

        .word-count .count-num {
            font-size: 15px;
        }

        .filter-trigger {
            display: none;
            align-items: center;
            gap: 7px;
            padding: 0 12px;
        }

        .word-grid {
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 12px;
        }

        .word-card {
            min-height: 118px;
            padding: 20px 14px 16px;
            border-radius: 16px;
            box-shadow: none;
            font-family: inherit;
            color: inherit;
            appearance: none;
        }

        .word-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 26px rgba(23, 26, 43, 0.08);
        }

        .word-card .speak-hint {
            display: flex;
            align-items: center;
            justify-content: center;
            right: 8px;
            bottom: 8px;
            width: 24px;
            height: 24px;
            border-radius: 8px;
            background: var(--primary-soft);
            opacity: 0.72;
            font-size: 11px;
        }

        .filter-backdrop {
            display: none;
        }

        .fab {
            right: max(20px, env(safe-area-inset-right));
            bottom: max(20px, env(safe-area-inset-bottom));
        }

        .fab .btn-round:not(.back-to-top) {
            display: none;
        }

        .back-to-top {
            opacity: 0;
            pointer-events: none;
            transform: translateY(10px);
        }

        .back-to-top.visible {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0);
        }

        .chat-panel {
            height: min(620px, calc(100vh - 116px));
        }

        @media (min-width: 1180px) {
            .word-grid {
                grid-template-columns: repeat(5, minmax(0, 1fr));
            }
        }

        @media (max-width: 1040px) {
            .header-inner {
                grid-template-columns: minmax(150px, 0.7fr) minmax(260px, 1fr) auto;
                grid-template-areas:
                    "brand pages actions"
                    "search search search";
                gap: 10px 14px;
            }

            .brand { grid-area: brand; }
            .page-switcher { grid-area: pages; }
            .search-wrap { grid-area: search; }
            .header-actions { grid-area: actions; }

            .container {
                grid-template-columns: 1fr;
                margin-top: 22px;
            }

            .filter-trigger {
                display: inline-flex;
            }

            .filter-panel {
                position: fixed;
                z-index: 2200;
                top: auto;
                right: 12px;
                bottom: 12px;
                left: 12px;
                max-height: min(76vh, 620px);
                padding: 18px 14px max(18px, env(safe-area-inset-bottom));
                border-radius: 22px;
                box-shadow: 0 24px 80px rgba(8, 10, 20, 0.28);
                transform: translateY(calc(100% + 32px));
                transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
            }

            .filter-panel.active {
                transform: translateY(0);
            }

            .filter-panel-header {
                padding: 0 4px 14px;
            }

            .filter-panel-title {
                font-size: 17px;
            }

            .filter-close {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: 40px;
                height: 40px;
                border: 0;
                border-radius: 12px;
                background: var(--tag-bg);
                color: var(--text);
                font-size: 22px;
                cursor: pointer;
            }

            .categories {
                max-height: calc(min(76vh, 620px) - 92px);
            }

            .filter-backdrop {
                position: fixed;
                z-index: 2100;
                inset: 0;
                display: block;
                background: rgba(8, 10, 20, 0.46);
                opacity: 0;
                pointer-events: none;
                transition: opacity 0.2s ease;
            }

            .filter-backdrop.active {
                opacity: 1;
                pointer-events: auto;
            }

            body.filter-open {
                overflow: hidden;
            }

            body.chat-open {
                overflow: hidden;
            }

            .word-grid {
                grid-template-columns: repeat(4, minmax(0, 1fr));
            }
        }

        @media (max-width: 768px) {
            header {
                padding: 10px 12px 12px;
            }

            .header-inner {
                grid-template-columns: 1fr auto;
                grid-template-areas:
                    "brand actions"
                    "pages pages"
                    "search search";
                gap: 9px 12px;
            }

            .brand-kicker {
                display: none;
            }

            .brand-title {
                font-size: 16px;
            }

            .page-switcher {
                border-radius: 12px;
            }

            .page-tab {
                min-height: 40px;
                padding: 6px 10px;
                font-size: 12.5px;
            }

            .page-tab .tab-subtitle {
                display: none;
            }

            #searchInput {
                min-height: 44px;
            }

            .ai-entry {
                width: 44px;
                padding: 0;
                justify-content: center;
                font-size: 18px;
            }

            .ai-entry-label {
                position: absolute;
                width: 1px;
                height: 1px;
                padding: 0;
                margin: -1px;
                overflow: hidden;
                clip: rect(0, 0, 0, 0);
                white-space: nowrap;
                border: 0;
            }

            .container {
                margin-top: 18px;
                padding: 0 12px 100px;
            }

            .results-header {
                align-items: center;
                margin-bottom: 12px;
            }

            .results-eyebrow {
                font-size: 10px;
            }

            .results-title {
                max-width: 48vw;
                overflow: hidden;
                font-size: 20px;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            .word-count {
                display: none;
            }

            .word-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 9px;
            }

            .word-card {
                min-height: 108px;
                padding: 17px 10px 14px;
                border-radius: 14px;
            }

            .word-card .main-word {
                padding: 0 14px;
                font-size: 1.08em;
            }

            .word-card .speak-hint {
                opacity: 0.8;
            }

            .chat-panel {
                top: 0;
                right: 0;
                bottom: 0;
                left: 0;
                width: 100%;
                height: 100dvh;
                border: 0;
                border-radius: 0;
            }

            .chat-header {
                padding-top: max(16px, env(safe-area-inset-top));
            }

            .chat-footer {
                padding-bottom: max(12px, env(safe-area-inset-bottom));
            }

            .fab {
                right: 14px;
                bottom: max(14px, env(safe-area-inset-bottom));
            }
        }

        @media (max-width: 380px) {
            .header-actions {
                gap: 5px;
            }

            .icon-btn,
            .ai-entry {
                width: 40px;
                min-height: 40px;
            }

            .results-title {
                max-width: 44vw;
                font-size: 18px;
            }

            .filter-trigger {
                min-height: 40px;
                padding: 0 10px;
                font-size: 12px;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            *,
            *::before,
            *::after {
                scroll-behavior: auto !important;
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
        }
    
    /* ═══════════════════════════════════════════════════════════
       全站导航适配(追加,不改动上面任何原有规则)
       --site-nav-h 由 /assets/css/site.css 提供
       ═══════════════════════════════════════════════════════════ */

    /* 页头原本 sticky top:0,现在改为从全站导航下沿开始吸顶 */
    header {
        top: var(--site-nav-h, 44px);
    }

    @media (min-width: 1041px) {

        /* 左侧分类栏同步下移,避免被导航遮住 */
        .filter-panel {
            top: calc(86px + var(--site-nav-h, 44px));
            max-height: calc(100vh - 108px - var(--site-nav-h, 44px));
        }

        .categories {
            max-height: calc(100vh - 165px - var(--site-nav-h, 44px));
        }
    }

    @media (max-width: 768px) {

        /* 窄屏页头有三行(品牌 / 词库切换 / 搜索),
           再叠一条 44px 常驻导航会占掉太多屏幕,故窄屏让页头随页面滚动 */
        header {
            position: static;
        }
    }
