:root {
  color-scheme: light;
  --background: #f9f9f7;
  --surface: #ffffff;
  --surface-low: #f4f4f2;
  --surface-high: #e8e8e6;
  --text: #1a1c1b;
  --muted: #4a5568;
  --outline: #c5c6cc;
  --navy: #1a2332;
  --navy-muted: #818a9d;
  --green: #065f46;
  --green-soft: #e8f3ef;
  --gold: #c5a059;
  --gold-soft: #fff6df;
  --blue-soft: #edf4ff;
  --blue: #315d99;
  --danger: #ba1a1a;
  --shadow: 0 4px 6px -1px rgba(0,0,0,.035), 0 10px 18px -3px rgba(0,0,0,.025), 0 22px 32px -8px rgba(0,0,0,.025);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); }
body { margin: 0; color: var(--text); background: var(--background); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 15px; line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.app-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column; width: 280px; padding: 48px 24px; border-right: 1px solid rgba(197,198,204,.22); background: var(--background); }
.sidebar-brand { display: block; padding: 0 16px; }
.sidebar-brand strong { display: block; color: var(--navy); font-size: 40px; line-height: 1; letter-spacing: .045em; }
.sidebar-brand small { display: block; margin-top: 10px; color: var(--muted); font-size: 14px; }
.navigation { display: grid; gap: 6px; margin-top: 44px; }
.navigation a { display: flex; align-items: center; gap: 15px; padding: 13px 16px; border-radius: 12px; color: var(--muted); font-size: 15px; font-weight: 600; letter-spacing: .035em; text-transform: uppercase; transition: color .18s ease, background .18s ease; }
.navigation a:hover { color: var(--navy); background: var(--surface-low); }
.navigation a.active { color: #fff; background: var(--navy); }
.nav-icon { display: grid; place-items: center; width: 21px; height: 21px; font-family: Georgia, serif; font-size: 18px; letter-spacing: 0; }
.sidebar-label { margin: 34px 16px -28px; color: #969ba4; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.sidebar-footer { display: flex; align-items: center; gap: 11px; margin-top: auto; padding: 24px 16px 0; border-top: 1px solid rgba(197,198,204,.24); }
.sidebar-footer .avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; background: var(--navy); font-size: 11px; font-weight: 700; }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { font-size: 14px; }
.sidebar-footer small { color: var(--muted); font-size: 11px; }

.main-column { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: flex-end; min-height: 56px; padding: 8px 48px; border-bottom: 1px solid rgba(197,198,204,.14); background: rgba(249,249,247,.84); backdrop-filter: blur(16px); }
.menu-button, .mobile-brand { display: none; }
.global-search { position: relative; display: flex; align-items: center; gap: 10px; width: 384px; min-height: 46px; padding: 0 12px 0 16px; border-radius: 12px; color: rgba(74,85,104,.5); background: var(--surface-low); }
.global-search > span { font-family: Georgia, serif; font-size: 20px; }
.global-search input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }
.global-search input::placeholder { color: #8d929b; }
.global-search kbd { padding: 2px 6px; border: 1px solid rgba(197,198,204,.45); border-radius: 4px; color: #8b9098; background: transparent; font-family: inherit; font-size: 10px; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 9px; color: var(--green); font-size: 13px; font-weight: 600; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.settings-button { display: grid; place-items: center; width: 36px; height: 36px; margin-left: 14px; border-radius: 50%; color: var(--navy); background: var(--surface-high); font-size: 14px; }

.page { width: min(1236px, 100%); margin: 0 auto; padding: 28px 48px 100px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 36px; }
.page-heading h1 { margin: 5px 0 0; color: var(--navy); font-size: clamp(36px, 5vw, 48px); line-height: 1.12; letter-spacing: -.045em; }
.page-heading p { max-width: 650px; margin: 13px 0 0; color: var(--muted); font-size: 18px; line-height: 1.7; }
.heading-actions { display: flex; flex: 0 0 auto; gap: 10px; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 12px; font-weight: 600; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--navy); box-shadow: 0 7px 16px rgba(26,35,50,.12); }
.button-primary:hover { background: #0f1724; }
.button-secondary { border-color: rgba(197,198,204,.42); color: var(--muted); background: var(--surface); }
.button-secondary:hover { color: var(--navy); background: var(--surface-low); }
.notice, .form-error { display: flex; align-items: center; gap: 9px; margin: -24px 0 28px; padding: 12px 15px; border-radius: 10px; }
.notice { color: var(--green); background: var(--green-soft); }
.form-error { color: var(--danger); background: #ffefef; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 18px; }
.stat-card { position: relative; min-height: 168px; padding: 24px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.stat-card > span { display: block; color: var(--muted); font-size: 16px; font-weight: 500; }
.stat-card > span::after { position: absolute; top: 27px; right: 27px; width: 7px; height: 7px; border: 4px solid var(--green-soft); border-radius: 50%; background: var(--green); content: ""; }
.stat-card.warning > span::after { border-color: var(--gold-soft); background: var(--gold); }
.stat-card strong { display: block; margin: 23px 0 6px; color: var(--navy); font-size: 46px; line-height: 1; letter-spacing: -.04em; }
.stat-card.warning strong { color: var(--gold); }
.stat-card small { display: block; color: var(--muted); font-size: 13px; }
.stat-card .positive { color: var(--green); font-weight: 600; }
.stat-card-link { transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease; }
.stat-card-link:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -5px rgba(0,0,0,.08), 0 24px 38px -12px rgba(0,0,0,.06); }
.stat-card-link.active { outline: 2px solid rgba(197,160,89,.45); outline-offset: -2px; }

.archive-global-search { width: min(816px, 100%); margin: 0 0 30px; border: 1px solid rgba(197,198,204,.28); background: var(--surface); box-shadow: 0 7px 20px rgba(20,30,45,.035); }

.archive-section { min-width: 0; }
.archive-tools { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.type-tabs { display: flex; gap: 25px; border-bottom: 1px solid rgba(197,198,204,.28); }
.type-tabs a { position: relative; padding: 0 1px 9px; color: var(--muted); font-size: 17px; }
.type-tabs a:hover { color: var(--navy); }
.type-tabs a.active { color: var(--navy); font-size: 22px; font-weight: 700; }
.type-tabs a.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--navy); content: ""; }
.filter-bar { display: flex; align-items: center; gap: 12px; }
.filter-bar > input[type="hidden"] { display: none; }
.search-field { display: flex; align-items: center; gap: 8px; width: 244px; min-height: 40px; padding: 0 11px; border: 1px solid rgba(197,198,204,.42); border-radius: 12px; color: rgba(74,85,104,.55); background: var(--surface); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; }
.select-field select { min-height: 40px; padding: 7px 32px 7px 10px; border: 1px solid rgba(197,198,204,.42); border-radius: 12px; color: var(--muted); background: var(--surface); }
.filter-bar .button { min-height: 40px; }

.entry-list { display: grid; gap: 15px; }
.entry-list-header, .entry-card { display: grid; grid-template-columns: 3fr 2fr 3fr 2fr 2fr; gap: 16px; align-items: center; }
.entry-list-header { padding: 0 24px 9px; border-bottom: 1px solid rgba(197,198,204,.28); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.entry-card { min-height: 112px; padding: 20px 24px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.entry-card:hover { transform: translateY(-1px); background: #fefefe; box-shadow: 0 6px 10px -2px rgba(0,0,0,.04), 0 16px 26px -5px rgba(0,0,0,.04); }
.term strong, .term span, .pronunciation strong, .pronunciation small, .meaning, .example { display: block; }
.term strong { color: var(--navy); font-size: 20px; line-height: 1.35; font-weight: 700; }
.term span { margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.term-meta { display: flex; flex-wrap: wrap; gap: 7px 10px; align-items: center; margin-top: 5px; }
.term-meta span { margin-top: 0; }
.term-meta small { padding: 4px 10px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 13px; font-weight: 700; line-height: 1.45; }
.pronunciation { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pronunciation strong { overflow: hidden; color: var(--navy); font-family: Arial, "Noto Sans", "Segoe UI", sans-serif; font-size: 15px; font-weight: 500; letter-spacing: .015em; text-overflow: ellipsis; white-space: nowrap; }
.pronunciation small { margin-top: 2px; color: #777e89; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.audio-button { display: grid; flex: 0 0 auto; place-items: center; width: 33px; height: 33px; padding: 0 0 0 2px; border: 0; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 9px; }
.audio-button:hover, .audio-button.playing { color: #fff; background: var(--green); }
.definition { min-width: 0; }
.meaning { color: var(--text); font-size: 15px; font-weight: 500; }
.example { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.labels { display: flex; flex-wrap: wrap; gap: 7px; }
.category, .tag, .pos-badge, .level-badge, .status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 5px; font-size: 12px; white-space: nowrap; }
.category { color: #3e4758; background: #dae3f7; }
.tag { color: var(--muted); background: var(--surface-high); }
.pos-badge { color: var(--green); background: var(--green-soft); }
.level-badge { color: #8b641d; background: var(--gold-soft); font-weight: 700; }
.status { gap: 6px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-new { color: var(--muted); background: var(--surface-high); }
.status-learning { color: var(--blue); background: var(--blue-soft); }
.status-mastered { color: var(--green); background: var(--green-soft); }
.entry-tail { display: flex; align-items: center; justify-content: flex-end; gap: 13px; }
.row-actions { display: flex; gap: 6px; opacity: 0; transition: opacity .16s ease; }
.entry-card:hover .row-actions, .row-actions:focus-within { opacity: 1; }
.row-actions form { margin: 0; }
.row-actions a, .row-actions button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; color: var(--muted); background: var(--surface-high); }
.row-actions a:hover { color: var(--navy); }
.row-actions button:hover { color: var(--danger); background: #ffdad6; }
.confirm-dialog { width: min(420px, calc(100% - 40px)); max-width: none; padding: 0; border: 0; border-radius: 20px; color: var(--text); background: transparent; box-shadow: 0 28px 70px rgba(15,23,36,.24); }
.confirm-dialog::backdrop { background: rgba(15,23,36,.38); backdrop-filter: blur(4px); }
.confirm-dialog[open] { animation: confirm-in .18s ease-out; }
.confirm-card { position: relative; padding: 30px; border-radius: 20px; background: var(--surface); text-align: center; }
.confirm-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: var(--surface-high); font-size: 20px; line-height: 1; }
.confirm-close:hover { color: var(--navy); background: var(--surface-low); }
.confirm-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 2px auto 18px; border-radius: 16px; color: var(--danger); background: #ffebe8; font-size: 24px; }
.confirm-card h2 { margin: 0; color: var(--navy); font-size: 22px; letter-spacing: -.02em; }
.confirm-card p { margin: 10px 0 26px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.confirm-actions .button { width: 100%; min-height: 46px; }
.button-danger { color: #fff; background: var(--danger); box-shadow: 0 8px 18px rgba(192,57,43,.18); }
.button-danger:hover { background: #a92e22; }
@keyframes confirm-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.panel-footer { display: flex; align-items: center; justify-content: center; gap: 17px; padding: 30px 0 4px; color: var(--muted); font-size: 14px; }
.panel-footer button { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(197,198,204,.4); border-radius: 50%; color: var(--muted); background: transparent; font-size: 18px; }
.panel-footer button:disabled { opacity: .4; cursor: default; }
.empty-state { padding: 60px 24px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 50%; color: var(--green); background: var(--green-soft); font-family: Georgia, serif; font-size: 21px; }
.empty-state h2 { margin: 0; font-size: 17px; }
.empty-state p { margin: 5px 0 18px; color: var(--muted); }

.form-page { width: min(1140px, 100%); }
.breadcrumbs { display: flex; gap: 8px; margin-bottom: 24px; color: var(--muted); font-size: 13px; }
.breadcrumbs a:hover { color: var(--navy); }
.breadcrumbs strong { color: var(--text); }
.form-heading { margin-bottom: 34px; }
.item-form { display: grid; gap: 18px; }
.form-section { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 34px; padding: 28px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.form-section-title { display: flex; align-items: flex-start; gap: 11px; }
.form-section-title > span { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 7px; color: #fff; background: var(--navy); font-size: 10px; font-weight: 700; }
.form-section-title h2 { margin: 1px 0 3px; font-size: 17px; }
.form-section-title p { margin: 0; color: var(--muted); font-size: 13px; }
.form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-fields label { display: grid; align-content: start; gap: 7px; color: var(--muted); font-size: 13px; }
.form-fields label > span { color: var(--text); font-weight: 600; }
.fixed-field { display: grid; align-content: start; gap: 7px; }
.fixed-field > span { color: var(--text); font-size: 13px; font-weight: 600; }
.fixed-field > strong { display: flex; align-items: center; min-height: 43px; padding: 11px 12px; border: 1px solid rgba(197,198,204,.32); border-radius: 10px; color: var(--navy); background: var(--surface-low); font-size: 14px; }
.fixed-field > small { color: var(--muted); font-size: 11px; }
.form-fields label em { color: var(--green); font-size: 9px; font-style: normal; }
.form-fields .wide { grid-column: 1 / -1; }
.form-fields input, .form-fields select, .form-fields textarea { width: 100%; padding: 11px 12px; border: 1px solid rgba(197,198,204,.42); border-radius: 10px; outline: 0; color: var(--text); background: var(--surface-low); resize: vertical; transition: border .15s ease, background .15s ease; }
.form-fields input:focus, .form-fields select:focus, .form-fields textarea:focus { border-color: var(--navy); background: var(--surface); }
.form-fields input::placeholder, .form-fields textarea::placeholder { color: #9b9fa6; }
.form-fields label small { color: var(--muted); font-size: 11px; }
.usage-field { min-width: 0; padding: 0; border: 0; }
.usage-field legend { margin-bottom: 9px; color: var(--text); font-size: 13px; font-weight: 600; }
.usage-field legend small { margin-left: 5px; color: var(--muted); font-size: 10px; font-weight: 400; }
.usage-options { display: flex; flex-wrap: wrap; gap: 8px; }
.usage-options label { display: block; cursor: pointer; }
.usage-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.usage-options span { display: block; padding: 7px 11px; border: 1px solid rgba(197,198,204,.42); border-radius: 999px; color: var(--muted); background: var(--surface-low); font-size: 12px; transition: .15s ease; }
.usage-options input:checked + span { border-color: rgba(0,105,80,.24); color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 2px rgba(0,105,80,.06); }
.usage-options input:disabled + span { opacity: .42; cursor: not-allowed; }
.usage-options input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: 2px; }
.lookup-input-row { display: flex; align-items: stretch; gap: 10px; }
.lookup-input-row input { flex: 1; min-width: 0; }
.lookup-input-row .lookup-button { flex: 0 0 auto; min-height: 43px; padding: 9px 16px; border-color: rgba(0,105,80,.18); color: var(--green); background: var(--green-soft); white-space: nowrap; }
.lookup-input-row .lookup-button:hover { color: #fff; background: var(--green); }
.lookup-input-row .lookup-button:disabled { opacity: .65; cursor: wait; transform: none; }
.lookup-input-row .lookup-button.selected { color: #fff; background: var(--green); box-shadow: 0 0 0 3px rgba(0,105,80,.12); }
.lookup-status { min-height: 17px; }
.lookup-status[data-state="success"] { color: var(--green); }
.lookup-status[data-state="error"] { color: var(--danger); }
.lookup-status[data-state="loading"] { color: var(--blue); }
.lookup-status[data-state="warning"] { color: #a86e16; }
.dictionary-credit { margin: -2px 2px 0; color: var(--muted); font-size: 11px; text-align: right; }
.dictionary-credit a { color: var(--blue); font-weight: 600; }
.dictionary-credit a:hover { text-decoration: underline; }
.ai-content-note { margin: -13px 2px 0; color: #8b6b2f; font-size: 11px; text-align: right; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 3px; }

.api-docs-page { width: min(1120px, 100%); }
.api-docs-intro, .api-response-card, .api-endpoint-card, .api-docs-note { border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.api-docs-intro { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 20px; padding: 24px; }
.api-docs-intro > div, .api-response-card > div { display: flex; align-items: center; gap: 12px; }
.api-docs-step { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: #fff; background: var(--navy); font-size: 10px; font-weight: 700; }
.api-docs-intro h2, .api-response-card h2 { margin: 0; color: var(--navy); font-size: 18px; }
.api-docs-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.api-docs-page code { font-family: "SFMono-Regular", Consolas, monospace; }
.api-docs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.api-endpoint-card { padding: 24px; }
.api-endpoint-heading { display: flex; align-items: center; gap: 10px; }
.api-endpoint-heading > code { color: var(--navy); font-size: 13px; font-weight: 700; }
.http-method { padding: 4px 8px; border-radius: 6px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 800; }
.http-method.post { color: var(--blue); background: var(--blue-soft); }
.api-endpoint-card.featured { grid-column: 1 / -1; border: 1px solid rgba(49,93,153,.16); }
.api-endpoint-card h2 { margin: 18px 0 3px; color: var(--navy); font-size: 20px; }
.api-endpoint-card > p { margin: 0; color: var(--muted); font-size: 12px; }
.api-endpoint-card h3 { margin: 22px 0 9px; color: var(--text); font-size: 12px; }
.api-parameter-table { display: grid; border: 1px solid rgba(197,198,204,.28); border-radius: 10px; overflow: hidden; }
.api-parameter-table > div { display: grid; grid-template-columns: 90px 52px 1fr; gap: 9px; align-items: center; padding: 9px 11px; background: var(--surface-low); }
.api-parameter-table > div + div { border-top: 1px solid rgba(197,198,204,.25); }
.api-parameter-table code { color: var(--navy); font-size: 11px; font-weight: 700; }
.api-parameter-table span { color: var(--green); font-size: 9px; font-weight: 700; }
.api-parameter-table p { margin: 0; color: var(--muted); font-size: 10px; }
.api-endpoint-card pre, .api-response-card pre { overflow: auto; margin: 0; padding: 15px; border-radius: 10px; color: #dce8e4; background: var(--navy); font-size: 11px; line-height: 1.7; }
.api-side-effect { margin-top: 13px; padding: 9px 11px; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 10px; }
.api-response-card { margin-top: 20px; padding: 24px; }
.api-response-card > div { margin-bottom: 16px; }
.api-docs-note { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-top: 20px; padding: 17px 20px; color: var(--muted); font-size: 11px; }
.api-docs-note strong { color: var(--navy); font-size: 12px; }
.api-docs-note code { padding: 5px 8px; border-radius: 6px; background: var(--surface-low); }

.import-page { width: min(1120px, 100%); }
.import-heading { margin-bottom: 30px; }
.import-form { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr); gap: 22px; align-items: start; }
.import-card { padding: 26px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.import-editor { min-height: 520px; }
.import-card-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
.import-card-heading.compact { margin-bottom: 18px; }
.import-step { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 8px; color: #fff; background: var(--navy); font-size: 10px; font-weight: 700; }
.import-card-heading h2 { margin: 1px 0 4px; color: var(--navy); font-size: 18px; }
.import-card-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.import-textarea { display: grid; gap: 9px; color: var(--text); font-size: 13px; font-weight: 600; }
.import-textarea textarea { width: 100%; min-height: 370px; padding: 18px; border: 1px solid rgba(197,198,204,.42); border-radius: 12px; outline: 0; color: var(--text); background: var(--surface-low); font: 15px/1.8 Arial, "Noto Sans", sans-serif; resize: vertical; }
.import-textarea textarea:focus { border-color: var(--navy); background: var(--surface); box-shadow: 0 0 0 3px rgba(26,35,50,.05); }
.import-textarea textarea::placeholder { color: #a3a7ae; }
.import-textarea small { color: var(--muted); font-size: 11px; font-weight: 400; }
.import-options { display: grid; gap: 18px; }
.file-drop { position: relative; display: grid; justify-items: center; gap: 6px; padding: 26px 16px; border: 1px dashed rgba(0,105,80,.3); border-radius: 12px; color: var(--muted); background: var(--green-soft); text-align: center; cursor: pointer; }
.file-drop:hover { border-color: var(--green); }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop .file-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 4px; border-radius: 10px; color: #fff; background: var(--green); font-size: 18px; }
.file-drop strong { color: var(--navy); font-size: 13px; }
.file-drop small { font-size: 11px; }
.import-check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.import-check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--green); }
.import-check span, .import-check strong, .import-check small { display: block; }
.import-check strong { color: var(--navy); font-size: 13px; }
.import-check small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.import-check.enabled { cursor: default; }
.auto-check { display: grid !important; place-items: center; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px; color: #fff; background: var(--green); font-size: 11px; font-weight: 700; }
.dedupe-note { display: flex; gap: 10px; margin-top: 20px; padding: 13px; border-radius: 10px; color: var(--muted); background: var(--surface-low); }
.dedupe-note > span { color: var(--green); font-weight: 700; }
.dedupe-note p { margin: 0; font-size: 11px; line-height: 1.55; }
.dedupe-note strong { display: block; margin-bottom: 2px; color: var(--text); font-size: 12px; }
.import-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.import-actions .button { width: 100%; }

.error-page { display: grid; min-height: 100vh; place-items: center; padding: 30px; text-align: center; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; color: #fff; background: var(--navy); font-weight: 700; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 10px; }
.error-brand { position: absolute; top: 28px; left: 28px; text-align: left; }
.error-page section h1 { margin: 0; font-size: 26px; }
.error-page section p { margin: 8px 0 22px; color: var(--muted); }
.login-page { position: relative; display: grid; min-height: 100vh; place-items: center; overflow: hidden; padding: 32px; background: radial-gradient(circle at 15% 15%, rgba(6,95,70,.09), transparent 30%), radial-gradient(circle at 85% 80%, rgba(197,160,89,.12), transparent 28%), var(--background); }
.login-page::before { position: absolute; width: 440px; height: 440px; border: 1px solid rgba(26,35,50,.06); border-radius: 50%; content: ""; transform: translate(-46vw, 34vh); }
.login-card { position: relative; width: min(460px, 100%); padding: 42px; border: 1px solid rgba(197,198,204,.28); border-radius: 24px; background: rgba(255,255,255,.9); box-shadow: 0 32px 80px rgba(26,35,50,.10); backdrop-filter: blur(18px); }
.login-brand { display: flex; align-items: baseline; gap: 12px; margin-bottom: 54px; color: var(--navy); }
.login-brand strong { font-size: 30px; line-height: 1; letter-spacing: .06em; }
.login-brand span { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.login-copy h1 { margin: 7px 0 8px; color: var(--navy); font-size: 34px; line-height: 1.2; letter-spacing: -.035em; }
.login-copy p { margin: 0 0 28px; color: var(--muted); font-size: 14px; }
.login-error { margin-bottom: 18px; padding: 11px 13px; border-radius: 10px; color: var(--danger); background: #ffefef; font-size: 13px; }
.login-form { display: grid; gap: 10px; }
.login-form label { color: var(--text); font-size: 13px; font-weight: 600; }
.login-form input { width: 100%; min-height: 50px; padding: 11px 14px; border: 1px solid rgba(197,198,204,.58); border-radius: 12px; outline: 0; color: var(--text); background: var(--surface-low); transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.login-form input:focus { border-color: var(--navy); background: var(--surface); box-shadow: 0 0 0 3px rgba(26,35,50,.07); }
.login-form .button { min-height: 50px; margin-top: 8px; }
.login-note { display: block; margin-top: 22px; color: #92979f; font-size: 11px; text-align: center; }
.mobile-bottom-nav { display: none; }

@media (max-width: 1100px) {
  .archive-tools { align-items: stretch; flex-direction: column; }
  .filter-bar { justify-content: flex-end; }
  .entry-list-header, .entry-card { grid-template-columns: 2.5fr 2fr 2.5fr 1.5fr 2fr; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-column { min-width: 0; }
  .topbar { justify-content: space-between; min-height: 58px; padding: 8px 20px; }
  .menu-button { display: none; }
  .mobile-brand { display: block; color: var(--navy); font-size: 23px; font-weight: 700; letter-spacing: .045em; }
  .archive-global-search { width: 100%; margin-left: 0; }
  .settings-button { display: none; }
  .page { padding: 28px 24px 110px; }
  .entry-list-header { display: none; }
  .entry-card { grid-template-columns: 2fr 1.5fr 2.2fr 1.4fr; }
  .entry-tail { grid-column: 1 / -1; justify-content: space-between; padding-top: 13px; border-top: 1px solid rgba(197,198,204,.22); }
  .row-actions { opacity: 1; }
  .mobile-bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 30; display: flex; align-items: center; justify-content: space-around; padding: 10px 16px 12px; border: 1px solid rgba(197,198,204,.28); border-radius: 24px 24px 0 0; background: rgba(255,255,255,.88); box-shadow: 0 -8px 24px rgba(0,0,0,.045); backdrop-filter: blur(18px); }
  .mobile-bottom-nav a { display: grid; justify-items: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 700; }
  .mobile-bottom-nav a span { font-size: 17px; }
  .mobile-bottom-nav a.active { color: var(--navy); }
  .form-section { grid-template-columns: 1fr; }
  .import-form { grid-template-columns: 1fr; }
  .import-editor { min-height: auto; }
  .api-docs-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
	.login-page { padding: 20px; }
	.login-card { padding: 30px 24px; border-radius: 20px; }
	.login-brand { margin-bottom: 42px; }
  .topbar { padding: 10px 16px; }
  .archive-global-search { width: 100%; min-height: 46px; padding: 0 12px 0 16px; justify-content: flex-start; background: var(--surface); }
  .archive-global-search kbd { display: none; }
  .topbar-actions { font-size: 0; }
  .topbar-actions .online-dot { display: none; }
  .page { padding: 22px 20px 110px; }
  .page-heading { align-items: flex-start; margin-bottom: 32px; }
  .page-heading { flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .page-heading h1 { font-size: 32px; }
  .page-heading p { font-size: 14px; }
  .page-heading .button { padding: 8px 11px; white-space: nowrap; }
  .stats-grid { grid-template-columns: 1fr; gap: 14px; margin-bottom: 18px; }
  .stat-card { min-height: 140px; }
  .stat-card strong { margin-top: 17px; font-size: 38px; }
  .archive-tools { gap: 18px; }
  .type-tabs { gap: 18px; overflow-x: auto; }
  .type-tabs a { white-space: nowrap; }
  .type-tabs a.active { font-size: 17px; }
  .filter-bar { flex-wrap: wrap; }
  .search-field { width: 100%; }
  .select-field { flex: 1; }
  .select-field select { width: 100%; }
  .entry-card { grid-template-columns: 1fr; gap: 15px; padding: 19px 20px; }
  .pronunciation, .definition, .labels { padding-top: 12px; border-top: 1px solid rgba(197,198,204,.18); }
  .entry-tail { grid-column: auto; }
  .form-fields { grid-template-columns: 1fr; }
  .form-fields .wide { grid-column: auto; }
  .lookup-input-row { align-items: stretch; flex-direction: column; }
  .lookup-input-row .lookup-button { width: 100%; }
  .form-section { padding: 22px 18px; }
  .form-actions .button { flex: 1; }
  .api-docs-intro { grid-template-columns: 1fr; }
  .api-parameter-table > div { grid-template-columns: 72px 45px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
