/* ============ 外研版高中英语单词表 · 全局样式 ============ */
@font-face {
  font-family: 'MaShan';
  src: url('assets/MaShan.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Caveat';
  src: url('assets/Caveat.woff2') format('woff2');
  font-display: swap;
}
:root {
  --paper: #faf7f1;
  --paper2: #fffdf9;
  --ink: #2b2620;
  --ink2: #5c5348;
  --ink3: #8a7f70;
  --line: #e8e0d2;
  --accent: #1f4e79;
  --gold: #c9a86a;
  --ok: #2e7d5b;
  --warn: #b8722d;
  --bad: #b0413e;
  --card-shadow: 0 2px 12px rgba(60, 48, 30, .08);
  --font-hand-zh: 'MaShan', 'Kaiti SC', 'KaiTi', 'STKaiti', cursive;
  --font-hand-en: 'Caveat', 'Segoe Script', 'Comic Sans MS', cursive;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  background-image: radial-gradient(rgba(120, 100, 70, .045) 1px, transparent 1px);
  background-size: 22px 22px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d8cdb8; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 241, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1.5px solid var(--line);
  padding: 10px 18px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.brand .logo {
  font-family: var(--font-hand-zh); font-size: 26px; color: var(--accent);
  letter-spacing: 2px;
}
.brand .sub { font-size: 11px; color: var(--ink3); letter-spacing: 1px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 6px 12px; border-radius: 8px; font-size: 13px; color: var(--ink2);
  font-family: var(--font-hand-zh); font-size: 16px; letter-spacing: 1px;
  transition: all .15s;
}
.nav-links a:hover { background: #f0e9db; color: var(--ink); }
.nav-links a.active { background: var(--accent); color: #fff; }
.user-chip { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-chip .name { font-size: 13px; color: var(--ink2); max-width: 100px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- AI 翻译条 ---------- */
.translate-bar {
  width: 100%; display: flex; gap: 8px; align-items: stretch;
  background: var(--paper2); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 8px;
}
.translate-bar textarea {
  flex: 1; border: none; outline: none; resize: none; background: transparent;
  font-size: 14px; color: var(--ink); min-height: 38px; max-height: 100px; line-height: 1.5;
}
.translate-bar .t-btn {
  border: none; border-radius: 9px; padding: 0 18px;
  background: linear-gradient(135deg, #1f4e79, #2d6da8);
  color: #fff; font-size: 15px; font-family: var(--font-hand-zh); letter-spacing: 2px;
  transition: transform .1s;
}
.translate-bar .t-btn:hover { transform: translateY(-1px); }
.translate-bar .t-btn:disabled { opacity: .5; cursor: wait; }
.t-results {
  width: 100%; display: none; gap: 10px; margin-top: 2px;
}
.t-results.show { display: grid; grid-template-columns: 1fr 1fr; }
.t-card {
  background: var(--paper2); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 10px 14px; position: relative; overflow: hidden;
}
.t-card .t-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 2px 10px; border-radius: 20px; color: #fff; margin-bottom: 6px;
}
.t-card.local .t-tag { background: #6b4e16; }
.t-card.online .t-tag { background: #0e6b64; }
.t-card .t-text { font-size: 15px; line-height: 1.7; font-weight: 600; }
.t-card .t-score {
  position: absolute; top: 10px; right: 12px; font-size: 11px; color: var(--ink3);
}
.t-card .t-score b { font-size: 16px; color: var(--gold); font-family: var(--font-hand-en); }
.t-card .t-engine { font-size: 10.5px; color: var(--ink3); margin-top: 6px; }
.t-card.loading .t-text { color: var(--ink3); font-weight: 400; }
@media (max-width: 900px) { .t-results.show { grid-template-columns: 1fr; } }

/* ---------- 主体三栏 ---------- */
.layout { display: grid; grid-template-columns: 260px 1fr 220px; gap: 0; align-items: start; }
@media (max-width: 1100px) { .layout { grid-template-columns: 230px 1fr; } .toc-panel { display: none; } }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; } .left-panel { position: static !important; max-height: none !important; } }

.left-panel {
  position: sticky; top: 118px; max-height: calc(100vh - 130px);
  overflow-y: auto; padding: 14px 12px 30px 16px;
}
.main-panel { padding: 14px 20px 60px; min-width: 0; }
.toc-panel {
  position: sticky; top: 118px; max-height: calc(100vh - 130px);
  overflow-y: auto; padding: 14px 16px 30px 8px;
}

/* ---------- 左侧搜索 ---------- */
.panel-title {
  font-family: var(--font-hand-zh); font-size: 18px; color: var(--ink);
  letter-spacing: 2px; margin: 6px 0 8px; display: flex; align-items: center; gap: 6px;
}
.panel-title::before { content: ''; width: 4px; height: 16px; background: var(--gold); border-radius: 2px; }
.search-box {
  display: flex; align-items: center; gap: 6px;
  background: var(--paper2); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 7px 10px; margin-bottom: 8px;
}
.search-box input { flex: 1; border: none; outline: none; background: transparent; font-size: 13px; min-width: 0; }
.search-box .clear-btn { border: none; background: none; color: var(--ink3); font-size: 14px; display: none; }
.search-tip { font-size: 11px; color: var(--ink3); margin: 2px 2px 10px; line-height: 1.6; }
.search-results { display: flex; flex-direction: column; gap: 6px; }
.sr-item {
  background: var(--paper2); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; cursor: pointer; transition: all .12s;
}
.sr-item:hover { border-color: var(--gold); box-shadow: var(--card-shadow); transform: translateY(-1px); }
.sr-item .w { font-family: var(--font-hand-en); font-size: 18px; font-weight: 700; }
.sr-item .p { font-size: 11px; color: var(--ink3); margin-left: 6px; }
.sr-item .c { font-size: 12px; color: var(--ink2); margin-top: 2px; line-height: 1.5; }
.sr-item .loc { font-size: 10px; color: var(--gold); margin-top: 3px; }

/* ---------- 右侧目录 ---------- */
.toc-book { margin-bottom: 10px; }
.toc-book-head {
  display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 600; transition: background .12s;
}
.toc-book-head:hover { background: #f0e9db; }
.toc-book-head .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.toc-book-head .cnt { margin-left: auto; font-size: 10px; color: var(--ink3); font-weight: 400; }
.toc-units { padding: 2px 0 4px 14px; display: flex; flex-direction: column; gap: 1px; }
.toc-unit {
  font-size: 12px; color: var(--ink2); padding: 4px 8px; border-radius: 6px; cursor: pointer;
  border-left: 2px solid transparent; transition: all .12s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toc-unit:hover { background: #f0e9db; }
.toc-unit.active { background: #f0e9db; border-left-color: var(--gold); color: var(--ink); font-weight: 600; }

/* ---------- 中间单词列表 ---------- */
.book-block { margin-bottom: 26px; }
.book-head {
  display: flex; align-items: center; gap: 10px; margin: 18px 0 10px;
  padding: 10px 16px; border-radius: 12px; color: #fff;
}
.book-head h2 { font-family: var(--font-hand-zh); font-size: 22px; letter-spacing: 3px; font-weight: 400; }
.book-head .en { font-family: var(--font-hand-en); font-size: 16px; opacity: .85; }
.book-head .cnt { margin-left: auto; font-size: 11px; opacity: .9; background: rgba(255,255,255,.15); padding: 3px 10px; border-radius: 20px; }
.unit-block { margin-bottom: 14px; scroll-margin-top: 130px; }
.unit-head {
  display: flex; align-items: baseline; gap: 10px; margin: 12px 0 6px;
  border-bottom: 1.5px dashed var(--line); padding-bottom: 5px; scroll-margin-top: 130px;
}
.unit-head .uno {
  font-family: var(--font-hand-en); font-size: 15px; font-weight: 700; color: #fff;
  background: var(--uc, var(--accent)); border-radius: 6px; padding: 1px 9px;
}
.unit-head h3 { font-family: var(--font-hand-en); font-size: 21px; font-weight: 700; letter-spacing: .5px; }
.unit-head .ucnt { margin-left: auto; font-size: 11px; color: var(--ink3); }

.word-table { background: var(--paper2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.word-row {
  display: grid; grid-template-columns: 34px minmax(120px, 1.15fr) minmax(110px, 1fr) 1.6fr;
  gap: 8px; align-items: center; padding: 7px 12px;
  border-bottom: 1px solid #f0ead9; cursor: pointer; transition: background .1s;
}
.word-row:last-child { border-bottom: none; }
.word-row:hover { background: #fdf6e7; }
.word-row .idx { font-size: 10px; color: #c9bfa8; text-align: center; font-family: var(--font-hand-en); }
.word-row .w { font-family: var(--font-hand-en); font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1.15; word-break: break-word; }
.word-row .p { font-size: 12px; color: var(--ink3); word-break: break-all; }
.word-row .c { font-size: 12.5px; color: var(--ink2); line-height: 1.5; }
@media (max-width: 760px) {
  .word-row { grid-template-columns: 26px 1fr; grid-auto-rows: auto; }
  .word-row .p { grid-column: 2; } .word-row .c { grid-column: 2; }
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(40, 32, 20, .45); backdrop-filter: blur(3px);
  z-index: 100; display: none; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 16px;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--paper2); border-radius: 16px; width: 640px; max-width: 100%;
  box-shadow: 0 12px 48px rgba(40, 30, 15, .28); animation: pop .18s ease-out;
  border: 1px solid #e5dcc8;
}
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  padding: 20px 24px 12px; display: flex; align-items: flex-start; gap: 12px;
  border-bottom: 1.5px dashed var(--line);
}
.modal-head .mw { font-family: var(--font-hand-en); font-size: 34px; font-weight: 700; line-height: 1; }
.modal-head .mp { font-size: 13px; color: var(--ink3); margin-top: 6px; }
.modal-head .play-btn {
  border: none; background: var(--accent); color: #fff; width: 34px; height: 34px;
  border-radius: 50%; font-size: 14px; flex: none; margin-top: 4px;
}
.modal-head .loc-badge {
  margin-left: auto; font-size: 10.5px; color: var(--gold); border: 1px solid var(--gold);
  border-radius: 20px; padding: 2px 10px; white-space: nowrap;
}
.modal-close {
  position: absolute; border: none; background: none; font-size: 22px; color: var(--ink3);
  right: 14px; top: 10px;
}
.modal-body { padding: 14px 24px 22px; max-height: 68vh; overflow-y: auto; }
.m-sec { margin-bottom: 14px; }
.m-sec-title {
  font-size: 12px; color: #fff; background: var(--ink2); display: inline-block;
  border-radius: 6px; padding: 2px 10px; margin-bottom: 8px; letter-spacing: 1px;
}
.m-sec-title.online { background: #0e6b64; }
.m-sec-title.collins { background: #5b3b8c; }
.m-sec-title.sl { background: linear-gradient(135deg, #c9803a, #a8552e); }
.m-sec-title.youdao { background: #8e3b54; }
.m-sec-body { font-size: 13.5px; line-height: 1.75; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.m-sec-body .def-en { color: var(--ink2); }
.m-sec-body .ex { color: var(--ink3); font-size: 12.5px; font-style: italic; }
.m-loading { color: var(--ink3); font-size: 12.5px; padding: 6px 0; }
.m-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.m-tag { font-size: 10.5px; background: #f0e9db; color: var(--ink2); border-radius: 5px; padding: 2px 8px; }
.modal { position: relative; }

/* ---------- 登录弹窗 ---------- */
.auth-form { padding: 24px; }
.auth-form h3 { font-family: var(--font-hand-zh); font-size: 24px; letter-spacing: 3px; margin-bottom: 14px; text-align: center; }
.auth-form input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 14px; margin-bottom: 10px; outline: none; background: var(--paper);
}
.auth-form input:focus { border-color: var(--gold); }
.auth-form .btn-main {
  width: 100%; border: none; border-radius: 10px; padding: 11px;
  background: var(--accent); color: #fff; font-size: 15px; letter-spacing: 2px;
}
.auth-form .switch { text-align: center; font-size: 12px; color: var(--ink3); margin-top: 10px; }
.auth-form .switch a { color: var(--accent); cursor: pointer; }
.auth-err { color: var(--bad); font-size: 12px; min-height: 16px; margin-bottom: 6px; text-align: center; }

/* ---------- 通用按钮 ---------- */
.btn {
  border: 1.5px solid var(--line); background: var(--paper2); color: var(--ink2);
  border-radius: 9px; padding: 7px 14px; font-size: 13px; transition: all .12s;
}
.btn:hover { border-color: var(--gold); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.small { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn.danger { color: var(--bad); border-color: #e0b6b4; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(43, 38, 32, .92); color: #fff; padding: 9px 22px; border-radius: 24px;
  font-size: 13px; z-index: 300; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }

/* ---------- 卡片阅读页 ---------- */
.read-stage {
  position: fixed; inset: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.read-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(18px) brightness(.72); transform: scale(1.1); transition: background-image .5s; }
.read-card {
  position: relative; z-index: 2; width: min(680px, 92vw);
  background: rgba(255, 252, 245, .9); backdrop-filter: blur(6px);
  border-radius: 22px; padding: 42px 48px 34px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.5);
}
.read-word { font-family: var(--font-hand-en); font-size: 58px; font-weight: 700; line-height: 1.05; color: var(--ink); }
.read-phon { font-size: 16px; color: var(--ink2); margin-top: 8px; }
.read-meaning {
  font-family: var(--font-hand-zh); font-size: 24px; color: var(--ink); margin-top: 18px;
  line-height: 1.6; letter-spacing: 1px;
}
.read-extra { margin-top: 18px; text-align: left; background: rgba(43,38,32,.05); border-radius: 12px; padding: 12px 16px; font-size: 13px; line-height: 1.8; color: var(--ink2); }
.read-extra b { color: var(--ink); }
.read-actions { display: flex; gap: 10px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.read-actions .btn { background: rgba(255,255,255,.75); }
.read-top {
  position: absolute; top: 18px; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: space-between; padding: 0 22px; color: rgba(255,255,255,.9);
}
.read-top .back { background: rgba(0,0,0,.3); border: none; color: #fff; border-radius: 20px; padding: 6px 16px; font-size: 13px; }
.read-progress { font-size: 13px; background: rgba(0,0,0,.3); border-radius: 20px; padding: 6px 16px; }
.read-imgcredit { position: absolute; bottom: 10px; right: 16px; z-index: 3; font-size: 10px; color: rgba(255,255,255,.55); }

/* ---------- 背单词页 ---------- */
.study-wrap { max-width: 760px; margin: 0 auto; padding: 24px 18px 80px; }
.study-setup {
  background: var(--paper2); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 26px 28px;
}
.study-setup h2 { font-family: var(--font-hand-zh); font-size: 26px; letter-spacing: 3px; margin-bottom: 4px; }
.study-setup .sub { color: var(--ink3); font-size: 12.5px; margin-bottom: 18px; }
.dir-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.dir-card {
  border: 2px solid var(--line); border-radius: 12px; padding: 16px; cursor: pointer;
  text-align: center; transition: all .12s; background: var(--paper);
}
.dir-card:hover { border-color: var(--gold); }
.dir-card.sel { border-color: var(--accent); background: #eef3f8; }
.dir-card .t { font-family: var(--font-hand-zh); font-size: 19px; letter-spacing: 2px; }
.dir-card .d { font-size: 11.5px; color: var(--ink3); margin-top: 4px; }
.study-stats { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.study-stats .chip { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-size: 12px; color: var(--ink2); }
.study-stats .chip b { font-size: 17px; color: var(--accent); font-family: var(--font-hand-en); margin-right: 3px; }

.quiz-card {
  background: var(--paper2); border: 1.5px solid var(--line); border-radius: 18px;
  padding: 34px 30px; text-align: center; min-height: 260px;
  display: flex; flex-direction: column; justify-content: center;
}
.quiz-q { font-size: 15px; color: var(--ink3); margin-bottom: 10px; }
.quiz-main { font-size: 34px; font-weight: 700; line-height: 1.3; word-break: break-word; }
.quiz-main.en { font-family: var(--font-hand-en); font-size: 44px; }
.quiz-main.zh { font-family: var(--font-hand-zh); font-size: 32px; letter-spacing: 2px; }
.quiz-input { margin-top: 18px; display: flex; gap: 8px; justify-content: center; }
.quiz-input input {
  width: min(340px, 70vw); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 16px; outline: none; background: var(--paper); text-align: center;
}
.quiz-input input:focus { border-color: var(--gold); }
.quiz-answer { margin-top: 16px; font-size: 17px; line-height: 1.7; display: none; }
.quiz-answer .a-main { font-weight: 700; font-size: 19px; }
.quiz-answer .a-sub { color: var(--ink3); font-size: 13px; margin-top: 4px; }
.quiz-answer.ok { color: var(--ok); }
.quiz-answer.bad { color: var(--bad); }
.quiz-btns { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }
.quiz-btns .btn { min-width: 110px; padding: 10px 18px; font-size: 14px; }
.quiz-btns .btn.know { background: var(--ok); border-color: var(--ok); color: #fff; }
.quiz-btns .btn.dunno { background: var(--bad); border-color: var(--bad); color: #fff; }
.quiz-btns .btn.fuzzy { background: var(--warn); border-color: var(--warn); color: #fff; }
.quiz-progress { margin-top: 20px; height: 7px; background: #eee5d3; border-radius: 4px; overflow: hidden; }
.quiz-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); transition: width .3s; }
.quiz-count { text-align: center; font-size: 12px; color: var(--ink3); margin-top: 8px; }

/* ---------- 管理端 ---------- */
.admin-wrap { max-width: 1000px; margin: 0 auto; padding: 22px 16px 80px; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.admin-card { background: var(--paper2); border: 1.5px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; }
.admin-card .v { font-size: 30px; font-family: var(--font-hand-en); font-weight: 700; color: var(--accent); }
.admin-card .k { font-size: 12px; color: var(--ink3); margin-top: 2px; }
.admin-sec { background: var(--paper2); border: 1.5px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.admin-sec h3 { font-family: var(--font-hand-zh); font-size: 19px; letter-spacing: 2px; margin-bottom: 12px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th { text-align: left; color: var(--ink3); font-weight: 400; padding: 6px 8px; border-bottom: 1.5px solid var(--line); }
.admin-table td { padding: 7px 8px; border-bottom: 1px solid #f0ead9; }
.stage-bar { display: flex; gap: 3px; align-items: flex-end; height: 60px; }
.stage-bar i { flex: 1; background: var(--gold); border-radius: 3px 3px 0 0; min-height: 3px; }

footer.page-foot { text-align: center; color: var(--ink3); font-size: 11px; padding: 30px 0 40px; }

/* ============ v2 视觉升级：鸿蒙动效 + 毛玻璃 + 必应背景 ============ */
:root {
  --ease-hm: cubic-bezier(0.32, 0.72, 0, 1);      /* 鸿蒙标准缓动 */
  --ease-hm-out: cubic-bezier(0.2, 0.6, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.44, 1); /* 轻微回弹 */
  --glass-bg: rgba(255, 253, 249, .72);
  --glass-border: rgba(255, 255, 255, .55);
}

/* ---- 必应背景层 ---- */
.bg-layer {
  position: fixed; inset: 0; z-index: -2;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.2s var(--ease-hm);
}
.bg-layer.show { opacity: 1; }
.bg-overlay {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(160deg, rgba(250,247,241,.88) 0%, rgba(250,247,241,.82) 45%, rgba(246,241,231,.9) 100%);
}
body.has-bg { background-color: transparent; background-image: none; }

/* ---- 顶栏毛玻璃 ---- */
.topbar {
  background: rgba(252, 250, 245, .62);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border-bottom: 1px solid rgba(200, 185, 155, .35);
  box-shadow: 0 1px 18px rgba(90, 75, 50, .06);
}

/* ---- 面板毛玻璃化 ---- */
.translate-bar, .t-card, .search-box, .sr-item, .word-table, .book-head,
.study-setup, .quiz-card, .admin-card, .admin-sec, .read-card, .auth-form {
  background: var(--glass-bg);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-color: var(--glass-border);
}
.word-table { background: rgba(255, 253, 249, .66); }
.word-row:hover { background: rgba(255, 243, 214, .65); }

/* ---- 鸿蒙式弹窗动画 ---- */
.modal-mask {
  transition: opacity .32s var(--ease-hm);
  opacity: 0;
}
.modal-mask.show { opacity: 1; }
.modal-mask:not(.show) { pointer-events: none; display: flex !important; visibility: hidden; }
.modal-mask.showing { visibility: visible; }
.modal-mask.show { visibility: visible; }
.modal {
  animation: hmPop .38s var(--ease-spring) both;
  background: rgba(255, 253, 249, .82);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border: 1px solid var(--glass-border);
}
.modal-mask.closing { opacity: 0; }
.modal-mask.closing .modal { animation: hmClose .28s var(--ease-hm) both; }
@keyframes hmPop {
  from { transform: translateY(26px) scale(.92); opacity: 0; }
  60%  { opacity: 1; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes hmClose {
  from { transform: translateY(0) scale(1); opacity: 1; }
  to   { transform: translateY(18px) scale(.94); opacity: 0; }
}

/* ---- 按钮微交互 ---- */
.btn, .t-btn, .btn-main, .play-btn, .quiz-btns .btn, .read-actions .btn {
  transition: transform .18s var(--ease-hm), box-shadow .18s var(--ease-hm),
              background .18s, border-color .18s, color .18s, opacity .18s;
}
.btn:hover, .btn.primary:hover, .read-actions .btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(60, 48, 25, .14);
}
.btn:active, .t-btn:active, .btn-main:active, .quiz-btns .btn:active {
  transform: scale(.965);
  box-shadow: 0 2px 6px rgba(60, 48, 25, .12);
}
.nav-links a { transition: background .2s var(--ease-hm), color .2s, transform .2s var(--ease-hm); }
.nav-links a:hover { transform: translateY(-1px); }

/* ---- 搜索结果逐个浮现 ---- */
@keyframes itemIn {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.sr-item { animation: itemIn .4s var(--ease-hm-out) both; }
.sr-item:nth-child(1) { animation-delay: .02s; }
.sr-item:nth-child(2) { animation-delay: .06s; }
.sr-item:nth-child(3) { animation-delay: .1s; }
.sr-item:nth-child(4) { animation-delay: .14s; }
.sr-item:nth-child(5) { animation-delay: .18s; }
.sr-item:nth-child(6) { animation-delay: .22s; }
.sr-item:nth-child(n+7) { animation-delay: .26s; }

/* ---- 翻译结果卡片滑入 ---- */
@keyframes cardUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.t-results.show .t-card { animation: cardUp .45s var(--ease-hm-out) both; }
.t-results.show .t-card.online { animation-delay: .08s; }

/* ---- 单词行入场（首次渲染） ---- */
@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.unit-block { animation: rowIn .5s var(--ease-hm-out) both; }

/* ---- 搜索框聚焦光晕 ---- */
.search-box { transition: border-color .25s, box-shadow .25s, background .25s; }
.search-box:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 106, .18);
  background: rgba(255, 253, 249, .92);
}
.translate-bar { transition: border-color .25s, box-shadow .25s; }
.translate-bar:focus-within {
  border-color: rgba(31, 78, 121, .55);
  box-shadow: 0 0 0 3px rgba(31, 78, 121, .1);
}

/* ---- 目录项动效 ---- */
.toc-unit { transition: background .18s var(--ease-hm), border-color .18s, padding-left .18s var(--ease-hm); }
.toc-unit.active { padding-left: 12px; }
.toc-book-head { transition: background .18s var(--ease-hm); }

/* ---- 单词详情区块渐入 ---- */
.m-sec { animation: itemIn .4s var(--ease-hm-out) both; }
.m-sec:nth-child(2) { animation-delay: .05s; }
.m-sec:nth-child(3) { animation-delay: .1s; }
.m-sec:nth-child(4) { animation-delay: .15s; }

/* ---- 阅读页卡片呼吸感 ---- */
.read-card { animation: hmPop .5s var(--ease-spring) both; }
.read-bg { transition: background-image .6s ease, filter .6s ease; }

/* ---- 答题卡片切换 ---- */
@keyframes quizSwap {
  from { transform: translateX(26px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.quiz-card.swap { animation: quizSwap .32s var(--ease-hm-out); }

/* ---- 侧栏毛玻璃 ---- */
.left-panel, .toc-panel {
  background: rgba(252, 249, 243, .35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ---- 减少动态效果偏好 ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
