/* ==========================================================================
   词镜 WordLens · Trianon 细节层（跨页面通用母题）
   编号体系 / 刻度 / 齿孔 / 纸页堆叠 / 分隔花饰
   只做视觉增强，不改结构。
   ========================================================================== */

/* ------------------------------------------------ 01 · 页面编号 */
#view-result .result-head .eyebrow::before,
#view-vocab .result-head .eyebrow::before,
#view-study .result-head .eyebrow::before {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5em;
  letter-spacing: .01em;
  color: var(--ink-soft);
  vertical-align: -1px;
}
#view-result .result-head .eyebrow::before { content: "N° 02 — "; }
#view-vocab .result-head .eyebrow::before { content: "N° 03 — "; }
#view-study .result-head .eyebrow::before { content: "N° 04 — "; }

/* ------------------------------------------------ 02 · 统计卡编号 */
.stats-row { counter-reset: statn; }
.stats-row .stat { counter-increment: statn; }
.stats-row .stat .label::before {
  content: counter(statn, decimal-leading-zero) " · ";
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  color: #a6adc6;
}

/* ------------------------------------------------ 03 · 进度条刻度 */
.gaokao-panel .gaokao-track { position: relative; overflow: hidden; }
.gaokao-panel .gaokao-track::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg,
      transparent 0 calc(10% - 1px),
      rgba(255, 255, 255, .72) calc(10% - 1px) 10%);
  border-radius: inherit;
  z-index: 2;
  pointer-events: none;
}
.gaokao-panel .gaokao-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg,
      transparent 0 calc(5% - 1px),
      rgba(46, 58, 99, .18) calc(5% - 1px) 5%);
  z-index: 1;
  pointer-events: none;
  opacity: .5;
}

/* ------------------------------------------------ 04 · 齿孔边 */
.study-card::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 26px;
  bottom: 26px;
  width: 7px;
  background:
    radial-gradient(circle 3.4px at 3.5px 3.5px, transparent 94%, rgba(30, 39, 72, .22) 100%) 0 0 / 7px 13px repeat-y;
  pointer-events: none;
  opacity: .85;
}
.study-card { position: relative; }

/* ------------------------------------------------ 05 · 纸页堆叠 */
.reading-layout { position: relative; z-index: 0; }
.reader-panel { position: relative; z-index: 1; }
.reader-panel::before {
  content: "";
  position: absolute;
  inset: 12px -9px -12px 12px;
  background: #f7f3e9;
  border: 1px solid rgba(135, 150, 180, .34);
  border-radius: 10px;
  transform: rotate(.45deg);
  z-index: -1;
  box-shadow: 0 10px 22px -18px rgba(40, 52, 95, .5);
}

/* ------------------------------------------------ 06 · 曲线图仪表角 */
.curve-chart { position: relative; }
.curve-chart::before {
  content: "";
  position: absolute;
  right: 16px;
  top: 4px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px dashed rgba(46, 58, 99, .26);
  pointer-events: none;
}
.curve-chart::after {
  content: "EBBINGHAUS";
  position: absolute;
  right: 16px;
  top: 60px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: .2em;
  color: #aeb4cb;
  pointer-events: none;
}

/* ------------------------------------------------ 07 · 分隔花饰 */
.how { position: relative; border-top: 1px dashed rgba(46, 58, 99, .28); }
.how::before {
  content: "✦";
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translateX(-50%);
  padding: 0 12px;
  background: var(--paper);
  font-size: 11px;
  line-height: 1.6;
  color: #b6bdd4;
}

/* ------------------------------------------------ 08 · 面板角标 */
.panel::before,
.paste-panel::before,
.gaokao-panel::before {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  left: -1px;
  top: -1px;
  border-top: 2px solid rgba(30, 39, 72, .55);
  border-left: 2px solid rgba(30, 39, 72, .55);
  border-radius: 2px 0 0 0;
  pointer-events: none;
}
.panel,
.paste-panel,
.gaokao-panel { position: relative; }

/* ------------------------------------------------ 09 · 阅读句号牌 */
.rsent-no {
  position: relative;
  color: #a6adc6;
}
.rsent-no::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  width: 1px;
  height: 8px;
  margin-left: -.5px;
  background: rgba(46, 58, 99, .2);
}

/* ------------------------------------------------ 10 · 词条标签纸 */
.dc-tags .badge,
.row-badges .badge { box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset; }

/* ------------------------------------------------ 11 · 队列页码 */
.queue-head {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(46, 58, 99, .22);
  padding-bottom: 7px;
}
.queue-head::after {
  content: "p. 01";
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: .14em;
  color: #b3b9cf;
}

/* ------------------------------------------------ 12 · 结果页抬头线 */
.result-head {
  position: relative;
  padding-bottom: 16px;
}
.result-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
      rgba(46, 58, 99, .34),
      rgba(46, 58, 99, .1) 46%,
      transparent 78%);
}

/* ------------------------------------------------ 13 · 设置页三栏 */
#settings-modal .modal-card {
  width: min(1160px, 96vw);
  height: min(780px, 90vh);
  max-height: none;
}

.set-body {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr) 236px;
  gap: 0;
  padding: 0 !important;
  overflow: hidden;
}

/* 左侧目录 */
.set-index {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 22px 14px;
  border-right: 1px solid rgba(46, 58, 99, .16);
  background: linear-gradient(180deg, #f7f4ec, #f1eee5);
}
.set-index-h {
  margin: 0 0 12px;
  padding: 0 6px 8px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .06em;
  color: #4a5a86;
  border-bottom: 1px dashed rgba(46, 58, 99, .24);
}
.set-index-h em {
  font-family: var(--script);
  font-style: normal;
  font-size: 24px;
  color: #1e2748;
  margin-right: 8px;
}
.set-index-it {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  text-align: left;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .04em;
  color: rgba(30, 39, 72, .74);
  cursor: pointer;
  border-radius: 7px;
  transition: background .2s, color .2s;
}
.set-index-it i {
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  color: #8d93ac;
  min-width: 16px;
}
.set-index-it:hover { background: rgba(255, 255, 255, .7); color: #1e2748; }
.set-index-it.on {
  background: #1e2748;
  color: #fbf9f4;
}
.set-index-it.on i { color: #e8c9d0; }
.set-index-note {
  margin: auto 6px 0;
  padding-top: 14px;
  border-top: 1px dashed rgba(46, 58, 99, .2);
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.8;
  letter-spacing: .08em;
  color: #a2a9c2;
}

/* 中间内容 */
.set-pane {
  overflow-y: auto;
  padding: 24px 28px 28px;
}
.set-pane .settings-section { padding-bottom: 20px; margin-bottom: 20px; }

/* 右侧栏 */
.set-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 18px;
  border-left: 1px solid rgba(46, 58, 99, .16);
  background: linear-gradient(180deg, #f7f4ec, #f2efe6);
}
.set-card {
  padding: 13px 13px 11px;
  background: linear-gradient(180deg, #fdfbf5, #f4f0e6);
  border: 1px solid rgba(135, 150, 180, .5);
  box-shadow: 0 12px 20px -18px rgba(40, 52, 95, .5), inset 0 1px 0 #fff;
  transform: rotate(-.7deg);
}
.set-card-t {
  margin: 0 0 6px;
  font-family: var(--script);
  font-size: 17px;
  color: #3d4a72;
}
.set-card-b {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .02em;
  color: #1e2748;
}
.set-card-n {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.65;
  color: rgba(30, 39, 72, .6);
}
.set-side-note {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.7;
  color: rgba(30, 39, 72, .56);
}
.set-side-note em {
  font-family: var(--script);
  font-style: normal;
  font-size: 14px;
  color: #9c6478;
}
.set-deco {
  margin-top: auto;
  align-self: flex-end;
  width: 76px;
  opacity: .8;
  transform: rotate(6deg);
  filter: drop-shadow(0 6px 10px rgba(30, 39, 72, .18));
}

@media (max-width: 900px) {
  #settings-modal .modal-card { height: min(760px, 94vh); width: 96vw; }
  .set-body { grid-template-columns: 1fr; }
  .set-index {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(46, 58, 99, .16);
  }
  .set-index-h, .set-index-note { display: none; }
  .set-index-it { width: auto; font-size: 12px; }
  .set-side { display: none; }

  #settings-modal .modal-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  #settings-modal .modal-foot > div:last-child { justify-content: flex-end; }
  #settings-modal .modal-foot .primary,
  #settings-modal .modal-foot .ghost { white-space: nowrap; flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reader-panel::before { transform: none; }
  .set-card { transform: none; }
}

/* ============================================================
   右侧抽屉覆盖（放在最后，压过上面的全宽设置样式）
   ============================================================ */
#settings-modal,
#daily-modal,
#guide-modal {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
}
#settings-modal .modal-card,
#daily-modal .modal-card,
#guide-modal .modal-card {
  width: 470px !important;
  max-width: 96vw !important;
  height: 100% !important;
  max-height: 100% !important;
  flex: 0 0 auto;
  border-radius: 22px 0 0 22px !important;
  box-shadow: -30px 0 70px -40px rgba(10, 20, 14, .55);
  animation: sheetIn .34s cubic-bezier(.2, .7, .3, 1) both;
}
#settings-modal .modal-body,
#daily-modal .daily-preview,
#guide-modal .modal-body {
  flex: 1;
  overflow-y: auto;
}
@keyframes sheetIn {
  from { transform: translateX(44px); opacity: .5; }
  to { transform: translateX(0); opacity: 1; }
}
@media (max-width: 720px) {
  #settings-modal .modal-card,
  #daily-modal .modal-card,
  #guide-modal .modal-card {
    width: 100% !important;
    border-radius: 0 !important;
  }
}

/* 设置抽屉：加宽 + 去掉左侧目录，单列 */
#settings-modal .modal-card {
  width: 680px !important;
}
#settings-modal .set-body {
  display: block !important;
}
#settings-modal .set-index {
  display: none !important;
}
#settings-modal .set-pane {
  padding: 0 !important;
}
@media (max-width: 720px) {
  #settings-modal .modal-card { width: 100% !important; }
}

/* 设置抽屉内边距 */
#settings-modal .set-pane {
  padding: 22px 28px 28px !important;
}


/* 设置 / 复盘 / 说明：作为普通页面视图，左侧导航常驻 */
#settings-modal.view,
#daily-modal.view,
#guide-modal.view {
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px 0 70px;
}
#settings-modal .modal-card,
#daily-modal .modal-card,
#guide-modal .modal-card {
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  border-radius: 20px !important;
  box-shadow: 0 26px 60px -42px rgba(10, 20, 14, .45) !important;
  animation: none !important;
  overflow: visible;
}
#settings-modal .modal-body,
#daily-modal .daily-preview,
#guide-modal .modal-body {
  overflow: visible !important;
  flex: none;
}


/* Trianon 搜索页：整页自适应 iframe（移除固定像素 + zoom:0.72，满幅锐利无裁切） */
#view-search.trianon-view {
  position: relative;
  inset: auto;
  z-index: auto;
  width: 100%;
  height: calc(100vh - 96px);
  min-height: 580px;
  margin: 12px 0 0;
  border-radius: 18px;
  overflow: hidden;
  background: #dfe4ee;
  box-shadow: 0 26px 70px -48px rgba(10, 20, 14, .45);
}
#view-search.trianon-view .trianon-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
#view-search.trianon-view[hidden] { display: none; }

.trianon-back {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 5;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid rgba(30, 43, 69, .28);
  background: rgba(251, 249, 244, .88);
  color: #1e2748;
  font-size: 12px;
  letter-spacing: .08em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .2s, color .2s;
}
.trianon-back:hover { background: #1e2748; color: #fbf9f4; }


/* Trianon 搜索模式：只关掉重装饰层，顶栏和左侧栏保留 */
body.trianon-open .ambient,
body.trianon-open .grain,
body.trianon-open .ouverture {
  display: none !important;
}


/* Trianon 模式隐藏引擎徽章与重复搜索条 */
body.trianon-open #egTag,
body.trianon-open .model-pill,
body.trianon-open .search-pill {
  display: none !important;
}
