:root {
    --ink: #0f1117;
    --paper: #f7f4ee;
    --paper-warm: #ede9df;
    --accent: #c8622a;
    --accent-light: #f0936a;
    --accent-faint: rgba(200,98,42,0.08);
    --accent-faint2: rgba(200,98,42,0.14);
    --muted: #7a7468;
    --border: #d4cfc5;
    --border-soft: #e8e4dc;
    --card-shadow: 0 1px 3px rgba(15,17,23,0.07), 0 8px 28px rgba(15,17,23,0.07);
    --red: #dc2626;
    --red-bg: #fef2f2;
    --red-border: #fca5a5;
    --green: #2d6a1f;
    --green-bg: #edf7e6;
    --green-border: #b8dfa8;
    --tag-cn: #2d5016;
    --tag-cn-bg: #e8f5db;
}
.hidden {
    display: none !important;
}
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--paper);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
header {
    background: var(--ink);
    padding: 0 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 200;
    gap: 1rem;
}

.logo {
    font-family: 'Playfair Display', serif;
    color: #fff;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    cursor: pointer;
    text-decoration: none;
}
.logo-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; flex-shrink: 0; }

.header-right { display: flex; align-items: center; gap: 1rem; }

.header-nav { display: flex; gap: 2rem; }
.header-nav a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    transition: color 0.2s;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    height: 20px;
}
.header-nav a:hover { color: #fff; }
.dev-menu-wrap { position: relative; display: inline-flex; align-items: center; }
.dev-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    height: 20px;
    line-height: 20px;
    font-family: 'DM Sans', sans-serif;
    vertical-align: middle;
}
.dev-menu-trigger:hover,
.dev-menu-trigger.open,
.dev-menu-trigger.active { color: #fff; }
.dev-chevron { color: rgba(255,255,255,0.45); transition: transform 0.22s; }
.dev-menu-trigger.open .dev-chevron { transform: rotate(180deg); }
.dev-menu-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 244px;
    background: #1c1f28;
    border: 1px solid rgba(255,255,255,0.12);
    border-top: 1px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.5);
    z-index: 450;
    overflow: visible;
}
.dev-menu-panel.open { display: block; animation: dropIn 0.16s ease; }
.dev-menu-panel a {
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.62);
    text-decoration: none;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-transform: none;
    line-height: 1.45;
    padding: 0.74rem 1rem;
    height: auto;
    min-height: 42px;
    white-space: nowrap;
    border-top: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s, color 0.15s;
}
.dev-menu-panel a:first-child { border-top: none; }
.dev-menu-panel a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.dev-menu-panel a.active { background: rgba(200,98,42,0.14); color: var(--accent-light); }

/* Auth buttons in header */
.header-auth { display: flex; align-items: center; gap: 0.6rem; }

.btn-header-login {
    color: rgba(255,255,255,0.7);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 7px;
    padding: 0.32rem 0.9rem;
    font-size: 0.76rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    white-space: nowrap;
}
.btn-header-login:hover { color: #fff; border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.06); }
.btn-header-login.active { color: #fff; border-color: rgba(255,255,255,0.5); }

.btn-header-register {
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 7px;
    padding: 0.38rem 1rem;
    font-size: 0.76rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-header-register:hover { background: #b5531f; }
.btn-header-register.active { background: #b5531f; box-shadow: 0 0 0 2px rgba(200,98,42,0.35); }

/* Language dropdown */
.lang-dropdown-wrap { position: relative; user-select: none; flex-shrink: 0; }
.lang-trigger {
    display: flex; align-items: center; gap: 0.45rem;
    background: transparent; border: 1px solid rgba(255,255,255,0.28);
    color: rgba(255,255,255,0.65); border-radius: 7px;
    padding: 0.3rem 0.65rem 0.3rem 0.75rem;
    font-size: 0.72rem; font-family: 'IBM Plex Mono', monospace;
    font-weight: 500; letter-spacing: 0.08em; cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s; white-space: nowrap;
}
.lang-trigger:hover { border-color: rgba(255,255,255,0.5); color: #fff; background: rgba(255,255,255,0.06); }
.lang-trigger.open { border-color: var(--accent-light); color: #fff; background: rgba(200,98,42,0.15); border-radius: 7px 7px 0 0; }
.lang-trigger-flag { font-size: 0.82rem; line-height: 1; }
.lang-chevron { color: rgba(255,255,255,0.4); transition: transform 0.22s; flex-shrink: 0; }
.lang-trigger.open .lang-chevron { transform: rotate(180deg); }
.lang-panel {
    display: none; position: absolute; top: 100%; right: 0; min-width: 150px;
    background: #1c1f28; border: 1px solid rgba(255,255,255,0.12);
    border-top: 1px solid var(--accent); border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.5); z-index: 400; overflow: hidden;
}
.lang-panel.open { display: block; animation: dropIn 0.16s ease; }
.lang-option { display: flex; align-items: center; gap: 0.65rem; padding: 0.6rem 0.9rem; cursor: pointer; transition: background 0.12s; border-top: 1px solid rgba(255,255,255,0.05); }
.lang-option:first-child { border-top: none; }
.lang-option:hover { background: rgba(255,255,255,0.06); }
.lang-option.selected { background: rgba(200,98,42,0.14); }
.lang-opt-flag { font-size: 0.9rem; flex-shrink: 0; }
.lang-opt-name { font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; font-weight: 500; color: rgba(255,255,255,0.55); flex: 1; }
.lang-option.selected .lang-opt-name { color: var(--accent-light); }
.lang-opt-check { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.18); flex-shrink: 0; position: relative; }
.lang-option.selected .lang-opt-check { background: var(--accent); border-color: var(--accent); }
.lang-option.selected .lang-opt-check::after {
    content: ''; position: absolute; width: 4px; height: 2.5px;
    border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff;
    transform: rotate(-45deg); top: 2.5px; left: 2px;
}

/* Hamburger */
.hamburger {
    display: none; flex-direction: column; justify-content: center; align-items: center;
    gap: 5px; width: 36px; height: 36px; background: none;
    border: 1px solid rgba(255,255,255,0.18); border-radius: 7px;
    cursor: pointer; padding: 4px; transition: background 0.2s, border-color 0.2s; flex-shrink: 0;
}
.hamburger:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.35); }
.hamburger span { display: block; width: 18px; height: 1.5px; background: rgba(255,255,255,0.8); border-radius: 2px; transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), opacity 0.2s ease; }
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
    display: none; flex-direction: column;
    position: fixed; top: 60px; left: 0; right: 0;
    background: #16191f; border-top: 1px solid rgba(255,255,255,0.07);
    z-index: 199; padding: 0.5rem 1.5rem 1.5rem;
    box-shadow: 0 12px 32px rgba(0,0,0,0.4); animation: slideDown 0.22s cubic-bezier(0.4,0,0.2,1);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
    color: rgba(255,255,255,0.65); text-decoration: none; font-size: 0.88rem;
    letter-spacing: 0.08em; padding: 0.9rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06); transition: color 0.15s; font-weight: 400;
}
.mobile-menu a:hover { color: #fff; }
.mobile-menu-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0.5rem;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.mobile-menu-group-label {
    font-size: 0.62rem;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.28);
    margin-bottom: 0.35rem;
    display: block;
}
.mobile-menu-group a {
    display: block;
    font-size: 0.84rem;
    text-transform: none;
    letter-spacing: 0.06em;
    padding: 0.7rem 0;
}
.mobile-menu-auth {
    display: flex; gap: 0.7rem; padding: 1rem 0 0.4rem;
    border-top: 1px solid rgba(255,255,255,0.06); margin-top: 0.4rem;
}
.mobile-menu-auth button {
    flex: 1; padding: 0.6rem; border-radius: 8px; font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.18s;
}
.mob-login-btn  { background: transparent; color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.22); }
.mob-login-btn:hover { color: #fff; border-color: rgba(255,255,255,0.5); }
.mob-reg-btn    { background: var(--accent); color: #fff; border: none; }
.mob-reg-btn:hover { background: #b5531f; }
.mobile-lang-section { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid rgba(255,255,255,0.06); }
.mobile-lang-label { font-size: 0.62rem; font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.28); margin-bottom: 0.5rem; display: block; }
.mobile-lang-options { display: flex; flex-direction: column; gap: 0.2rem; }
.mobile-lang-option { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.85rem; border-radius: 8px; cursor: pointer; transition: background 0.15s; border: 1px solid transparent; }
.mobile-lang-option:hover { background: rgba(255,255,255,0.05); }
.mobile-lang-option.selected { background: rgba(200,98,42,0.12); border-color: rgba(200,98,42,0.3); }
.mobile-lang-opt-flag { font-size: 1rem; flex-shrink: 0; }
.mobile-lang-opt-name { font-family: 'IBM Plex Mono', monospace; font-size: 0.82rem; font-weight: 500; color: rgba(255,255,255,0.5); flex: 1; }
.mobile-lang-option.selected .mobile-lang-opt-name { color: var(--accent-light); }
.mobile-lang-opt-check { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.18); position: relative; flex-shrink: 0; }
.mobile-lang-option.selected .mobile-lang-opt-check { background: var(--accent); border-color: var(--accent); }
.mobile-lang-option.selected .mobile-lang-opt-check::after {
    content: ''; position: absolute; width: 4px; height: 2.5px;
    border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff;
    transform: rotate(-45deg); top: 3px; left: 2px;
}

/* ══════════════════════════════════════
   HERO / SEARCH
══════════════════════════════════════ */
#search-view {
    flex: 1;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background:
            radial-gradient(ellipse 80% 50% at 50% 100%, rgba(200,98,42,0.07) 0%, transparent 70%),
            var(--paper);
}

.hero-eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 1.2rem;
    text-align: center;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.8rem);
    font-weight: 700;
    text-align: center;
    line-height: 1.15;
    color: var(--ink);
    margin-bottom: 0.6rem;
    max-width: 700px;
}

.hero-title em {
    font-style: italic;
    color: var(--accent);
}

.hero-subtitle {
    color: var(--muted);
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 3rem;
    max-width: 480px;
    line-height: 1.6;
}

/* ── SEARCH BOX ── */
.search-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 2.2rem;
    width: 100%;
    max-width: 680px;
    box-shadow: var(--card-shadow);
}

.search-label {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 500;
}

.search-input-wrap {
    position: relative;
    margin-bottom: 1.4rem;
}

.search-input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1.1rem 0.85rem 2.8rem;
    font-size: 1.05rem;
    font-family: 'Noto Serif SC', serif;
    color: var(--ink);
    background: var(--paper);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(200,98,42,0.12);
    background: #fff;
}

.search-input::placeholder { color: #b0a99c; }

.search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.standards-label {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.6rem;
    display: block;
    font-weight: 500;
}

/* ── CUSTOM DROPDOWN ── */
.std-dropdown-wrap {
    position: relative;
    margin-bottom: 1.6rem;
    user-select: none;
}

.std-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0.72rem 1rem;
    background: var(--paper);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.std-trigger:hover { border-color: var(--accent-light); background: #fff; }

.std-trigger.open {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(200,98,42,0.1);
    background: #fff;
    border-radius: 10px 10px 0 0;
}

.std-trigger-left {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.std-trigger-icon {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: var(--paper-warm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
}

.std-trigger-text { min-width: 0; }

.std-trigger-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.std-trigger-meta { font-size: 0.68rem; color: var(--muted); letter-spacing: 0.04em; }

.std-chevron {
    flex-shrink: 0;
    color: var(--muted);
    transition: transform 0.22s;
}

.std-trigger.open .std-chevron { transform: rotate(180deg); }

.std-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #fff;
    border: 1.5px solid var(--accent);
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 24px rgba(15,17,23,0.12);
    z-index: 200;
    max-height: 340px;
    overflow-y: auto;
}

.std-panel.open { display: block; animation: dropIn 0.18s ease; }

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.std-group-label {
    font-size: 0.65rem;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.7rem 1rem 0.3rem;
    border-top: 1px solid var(--border);
    font-weight: 500;
}

.std-group-label:first-child { border-top: none; }

.std-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: background 0.13s;
}

.std-option:hover { background: var(--paper); }
.std-option.selected { background: rgba(200,98,42,0.06); }

.std-option-icon {
    width: 30px; height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--paper-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.std-option.selected .std-option-icon {
    background: rgba(200,98,42,0.1);
    border-color: rgba(200,98,42,0.3);
}

.std-option-body { flex: 1; min-width: 0; }

.std-option-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ink);
}

.std-option.selected .std-option-name { color: var(--accent); }
.std-option-desc { font-size: 0.68rem; color: var(--muted); margin-top: 1px; }

.std-option-check {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.std-option.selected .std-option-check {
    background: var(--accent);
    border-color: var(--accent);
}

.std-option.selected .std-option-check::after {
    content: '';
    width: 5px; height: 3px;
    border-left: 1.5px solid #fff;
    border-bottom: 1.5px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
}

/* ── INLINE DROPDOWN ── */
.inline-std-wrap {
    position: relative;
    user-select: none;
    flex-shrink: 0;
}

.inline-std-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 0.52rem 0.85rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s;
    white-space: nowrap;
}

.inline-std-trigger:hover { border-color: var(--accent-light); }
.inline-std-trigger.open {
    border-color: var(--accent);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 0 0 3px rgba(200,98,42,0.08);
}

.inline-trigger-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ink);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inline-std-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: #fff;
    border: 1.5px solid var(--accent);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 20px rgba(15,17,23,0.12);
    z-index: 300;
    overflow: hidden;
}

.inline-std-panel.open { display: block; animation: dropIn 0.15s ease; }

.inline-std-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    transition: background 0.12s;
    border-top: 1px solid var(--border);
}

.inline-std-option:first-child { border-top: none; }
.inline-std-option:hover { background: var(--paper); }
.inline-std-option.selected { background: rgba(200,98,42,0.05); }

.inline-opt-flag { font-size: 0.85rem; flex-shrink: 0; }

.inline-opt-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ink);
    flex: 1;
}

.inline-std-option.selected .inline-opt-name { color: var(--accent); }

.inline-opt-check {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    flex-shrink: 0;
    position: relative;
}

.inline-std-option.selected .inline-opt-check {
    background: var(--accent);
    border-color: var(--accent);
}

.inline-std-option.selected .inline-opt-check::after {
    content: '';
    position: absolute;
    width: 4px; height: 2.5px;
    border-left: 1.5px solid #fff;
    border-bottom: 1.5px solid #fff;
    transform: rotate(-45deg);
    top: 3px; left: 2.5px;
}

.search-btn {
    width: 100%;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.9rem;
    font-size: 0.88rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-transform: uppercase;
}

.search-btn:hover { background: #2a2d38; }
.search-btn:active { transform: scale(0.99); }

.search-footer {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.stat-item { text-align: center; }

.stat-num {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    display: block;
}

.stat-desc {
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.stat-divider {
    width: 1px;
    background: var(--border);
    align-self: stretch;
}

/* ── RESULTS VIEW ── */
#results-view {
    display: none;
    flex-direction: column;
    flex: 1;
}

.results-bar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 1.1rem 3rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.results-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
    letter-spacing: 0.04em;
    font-weight: 500;
    flex-shrink: 0;
}

.results-back:hover { color: var(--ink); }

.results-query-display {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 1;
    flex-wrap: wrap;
    min-width: 0;
}

.query-chip {
    background: var(--ink);
    color: #fff;
    padding: 0.28rem 0.9rem;
    border-radius: 20px;
    font-family: 'Noto Serif SC', serif;
    font-size: 0.88rem;
    white-space: nowrap;
}

.std-chip {
    background: rgba(200,98,42,0.1);
    color: var(--accent);
    border: 1px solid rgba(200,98,42,0.25);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
}

.results-count {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.results-count strong { color: var(--ink); font-weight: 600; }

/* ── BREADCRUMB ── */
.results-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.03em;
    flex: 1;
}

.results-breadcrumb a {
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.18s;
    font-weight: 500;
}

.results-breadcrumb a:hover { color: var(--ink); }

.results-breadcrumb-sep {
    color: var(--border);
    font-size: 0.85rem;
    line-height: 1;
    user-select: none;
}

.results-breadcrumb-current {
    color: var(--ink);
    font-weight: 500;
}

/* Inline search bar */
.results-search-wrap {
    padding: 1.2rem 3rem;
    background: var(--paper-warm);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.inline-input {
    flex: 1;
    min-width: 160px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 0.58rem 1rem;
    font-family: 'Noto Serif SC', serif;
    font-size: 0.95rem;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.inline-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(200,98,42,0.1);
}

.inline-search-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.58rem 1.4rem;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.inline-search-btn:hover { background: #b5531f; }

/* ── RESULTS MAIN ── */
.results-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 3rem 0;
    width: 100%;
}

.results-section-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.section-count {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    text-transform: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.section-count strong { color: var(--ink); font-weight: 600; }

/* ── RESULT CARD ── */
.result-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 1.8rem;
    margin-bottom: 1rem;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    animation: slideUp 0.38s ease both;
}

.result-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 3px 0 0 3px;
    opacity: 0;
    transition: opacity 0.2s;
}

.result-card:hover {
    border-color: rgba(200,98,42,0.3);
    box-shadow: 0 4px 20px rgba(15,17,23,0.1);
}

.result-card:hover::before { opacity: 1; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-card:nth-child(1) { animation-delay: 0s; }
.result-card:nth-child(2) { animation-delay: 0.06s; }
.result-card:nth-child(3) { animation-delay: 0.12s; }
.result-card:nth-child(4) { animation-delay: 0.18s; }
.result-card:nth-child(5) { animation-delay: 0.24s; }

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.card-code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.22rem 0.65rem;
    white-space: nowrap;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    margin-top: 3px;
}

.card-title-wrap { flex: 1; min-width: 0; }

.card-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
    margin-bottom: 0.3rem;
}

.card-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.badge {
    font-size: 0.65rem;
    font-family: 'IBM Plex Mono', monospace;
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.badge-std {
    background: #e8f0fe;
    color: #2d5aba;
    border: 1px solid #c2d0f5;
}

.badge-country {
    background: var(--tag-cn-bg);
    color: var(--tag-cn);
    border: 1px solid #c8e6a0;
}

.card-description {
    font-size: 0.87rem;
    color: #4a4540;
    line-height: 1.65;
}

.card-description mark, .card-title mark,
.detail-item mark, .detail-exclude-item mark {
    background: rgba(200,98,42,0.15);
    color: var(--accent);
    border-radius: 2px;
    padding: 0 1px;
}

/* ── CARD DETAILS — SMOOTH ANIMATION ── */
.card-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    transition:
            max-height 0.48s cubic-bezier(0.4, 0, 0.2, 1),
            opacity    0.38s ease,
            margin-top 0.3s ease,
            padding-top 0.3s ease;
}

.card-details.open {
    max-height: 100%;
    opacity: 1;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.detail-label {
    font-size: 0.67rem;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.detail-content { font-size: 0.84rem; color: #4a4540; line-height: 1.7; }

.detail-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.detail-item::before {
    content: '›';
    color: var(--accent);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.detail-exclude-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
    color: #888;
}

.detail-exclude-item::before {
    content: '✕';
    color: #ccc;
    font-size: 0.65rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.card-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.9rem;
    font-size: 0.74rem;
    color: var(--muted);
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
    letter-spacing: 0.04em;
    background: none;
    border: none;
    padding: 0;
    font-family: 'DM Sans', sans-serif;
}

.card-toggle:hover { color: var(--accent); }

.toggle-icon {
    display: inline-block;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.8rem;
}

.card-toggle.open .toggle-icon { transform: rotate(180deg); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 5rem 2rem; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.35; }

/* ── PAGINATION ── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.8rem 0 1rem;
    flex-wrap: wrap;
}

.page-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.48rem 1.1rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 0.8rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s, opacity 0.15s;
    letter-spacing: 0.03em;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(200,98,42,0.04);
}

.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.page-info {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.74rem;
    color: var(--muted);
    letter-spacing: 0.06em;
    padding: 0 0.4rem;
    white-space: nowrap;
}

/* ── FOOTER ── */
footer {
    background: var(--ink);
    color: rgba(255,255,255,0.55);
    padding: 2.8rem 3rem 1.6rem;
    margin-top: auto;
}

.footer-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    padding-bottom: 1.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 1.2rem;
}

.footer-brand {}

.footer-logo {
    font-family: 'Playfair Display', serif;
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 0.65rem;
    letter-spacing: 0.02em;
}

.footer-contact-row {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.45);
    line-height: 1.7;
}

.footer-contact-row a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-contact-row a:hover { color: #fff; }

.footer-links {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    flex-wrap: wrap;
    padding-top: 0.2rem;
}

.footer-link-group {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.footer-link-group-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.22);
    margin-bottom: 0.25rem;
}

.footer-links a {
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    transition: color 0.2s;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 1px;
    background: var(--accent-light);
    transform: scaleX(0);
    transition: transform 0.2s;
    transform-origin: left;
}

.footer-links a:hover { color: rgba(255,255,255,0.9); }
.footer-links a:hover::after { transform: scaleX(1); }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-copyright {
    font-size: 0.74rem;
    color: rgba(255,255,255,0.28);
    letter-spacing: 0.02em;
    line-height: 1.6;
}

.footer-filings {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    align-items: center;
}

.footer-filings a {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.25);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.footer-filings a:hover { color: rgba(255,255,255,0.5); }

.footer-filing-sep {
    color: rgba(255,255,255,0.15);
    font-size: 0.7rem;
}

/* ── RESPONSIVE: Tablet ── */
@media (max-width: 768px) {
    header { padding: 0 1.5rem; }
    .results-bar { padding: 1rem 1.5rem; }
    .results-search-wrap { padding: 1rem 1.5rem; }
    .results-main { padding: 1.8rem 1.5rem 0; }
    .search-card { padding: 1.5rem 1.4rem; }
    .result-card { padding: 1.3rem 1.4rem; }
    footer { padding: 2.2rem 1.5rem 1.4rem; }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
    .footer-top { gap: 1.5rem; }
}

/* ── RESPONSIVE: Mobile (<700px) ── */
@media (max-width: 700px) {
    header {
        padding: 0 1rem;
        height: 54px;
    }

    .header-nav { display: none; }
    .lang-dropdown-wrap { display: none; }
    .header-auth { display: none; }
    .hamburger { display: flex; }

    #search-view {
        padding: 2.5rem 1.2rem 2rem;
        min-height: calc(100vh - 54px);
        justify-content: flex-start;
        padding-top: 3rem;
    }

    .hero-eyebrow { font-size: 0.62rem; letter-spacing: 0.12em; }
    .hero-title { font-size: 1.85rem; }
    .hero-subtitle { font-size: 0.88rem; margin-bottom: 2rem; max-width: 100%; }

    .search-card {
        padding: 1.2rem 1rem;
        border-radius: 12px;
    }

    .search-input {
        font-size: 0.95rem;
        padding: 0.8rem 1rem 0.8rem 2.6rem;
    }

    .std-trigger { padding: 0.65rem 0.85rem; }
    .std-trigger-meta { display: none; }

    .search-footer {
        gap: 0.75rem;
        margin-top: 2rem;
    }

    .stat-divider { display: none; }
    .stat-num { font-size: 1.3rem; }

    .results-bar {
        padding: 0.85rem 1rem;
        gap: 0.6rem;
    }

    .results-query-display { gap: 0.5rem; }
    .query-chip { font-size: 0.82rem; padding: 0.25rem 0.75rem; }
    .std-chip { font-size: 0.65rem; padding: 0.2rem 0.6rem; }
    .results-count { font-size: 0.74rem; }

    .results-search-wrap {
        padding: 0.85rem 1rem;
        gap: 0.5rem;
    }

    .inline-input { font-size: 0.9rem; }
    .inline-trigger-name { max-width: 80px; font-size: 0.68rem; }
    .inline-search-btn { padding: 0.55rem 1rem; }

    .results-main { padding: 1.2rem 1rem 0; }

    .result-card {
        padding: 1rem;
        border-radius: 10px;
        margin-bottom: 0.75rem;
    }

    .card-header { gap: 0.6rem; flex-wrap: wrap; }
    .card-code { font-size: 0.9rem; }
    .card-title { font-size: 0.96rem; }
    .card-description { font-size: 0.84rem; }

    .pagination { gap: 0.4rem; }
    .page-btn { padding: 0.42rem 0.85rem; font-size: 0.75rem; }
    .page-info { font-size: 0.7rem; }

    footer { padding: 1.8rem 1rem 1.2rem; }

    .footer-top {
        flex-direction: column;
        gap: 1.2rem;
        padding-bottom: 1.2rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1.2rem;
    }

    .footer-link-group {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0.3rem 1.2rem;
    }

    .footer-link-group-label {
        width: 100%;
        margin-bottom: 0;
    }

    .footer-filings { gap: 0.6rem; }
    .footer-filing-sep { display: none; }
    .footer-filings { flex-direction: column; align-items: flex-start; gap: 0.3rem; }

    .mobile-menu { top: 54px; }
}

/* ══════════════════════════════════════
   AVATAR DROP DOWN MENU
══════════════════════════════════════ */
.user-avatar-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 8px;
    transition: background 0.15s;
}
.user-avatar-wrap:hover { background: rgba(255,255,255,0.07); }
.user-avatar-wrap.open { background: rgba(255,255,255,0.07); }

.avatar-img {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.avatar-circle {
    width: 32px; height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0;
}
.avatar-name {
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255,255,255,0.72);
    letter-spacing: 0.01em;
}
.avatar-caret {
    width: 10px; height: 10px;
    color: rgba(255,255,255,0.3);
}
.avatar-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 160px;
    background: #1c1f28;
    border: 1px solid rgba(255,255,255,0.1);
    border-top: 2px solid var(--accent);
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.45);
    z-index: 500;
    overflow: hidden;
    animation: dropIn 0.16s ease;
}
.avatar-dropdown.open { display: block; }

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.avatar-dd-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}
.avatar-dd-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.avatar-dd-icon { font-size: 0.88rem; flex-shrink: 0; }
.avatar-dd-divider { height: 1px; background: rgba(255,255,255,0.07); margin: 0; }
.avatar-dd-danger { color: rgba(217,64,64,0.75); }
.avatar-dd-danger:hover { background: rgba(217,64,64,0.1); color: var(--red); }

/* Mobile user avatar */
.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mobile-avatar-img {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.mobile-avatar-circle {
    width: 40px; height: 40px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}
.mobile-nickname {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
}
.mobile-menu-auth.logged-in {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}
.mobile-menu-auth.mob-set-btn,
.mobile-menu-auth.mob-logout-btn {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0.85rem 1rem;
    text-align: left;
    color: rgba(255,255,255,0.75);
}
.mobile-menu-auth.mob-set-btn:hover,
.mobile-menu-auth.mob-logout-btn:hover {
    background: rgba(255,255,255,0.05);
}
.mobile-menu-auth.mob-logout-btn {
    color: rgba(217,64,64,0.75);
}
.mobile-menu-auth.mob-logout-btn:hover {
    background: rgba(217,64,64,0.1);
}