/* TEVIA Kimi 版 · 宝石学习馆样式 */

.gems-page { padding-bottom: clamp(60px, 8vw, 110px); }

/* 页首 */
.gp-hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px);
  padding-top: clamp(40px, 6vw, 80px); align-items: start;
}
.gp-intro h1 { font-family: var(--font-serif); font-size: clamp(36px, 5vw, 56px); margin-bottom: 16px; }
.gp-lead { font-size: 19px; margin-bottom: 12px; }
.gp-desc { color: var(--muted); max-width: 460px; }
.gp-stats { display: flex; gap: clamp(22px, 3.5vw, 48px); margin-block: 28px; }
.gp-stats dt { font-size: 12px; letter-spacing: .14em; color: var(--faint); }
.gp-stats dd { font-family: var(--font-serif); font-size: 28px; margin-top: 4px; }
.gp-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.gp-specimen { border: 1px solid var(--line); background: var(--surface); padding: 18px; }
.gp-spec-head {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12px; letter-spacing: .16em; color: var(--muted); margin-bottom: 14px;
}
.gp-spec-frame { background: var(--dark); }
.gp-spec-frame img { width: 100%; }
.gp-spec-note { font-size: 14px; color: var(--muted); margin-block: 12px; }
.gp-spec-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border-top: 1px dotted var(--line); padding-top: 14px;
}
.gp-spec-foot p { font-size: 12.5px; color: var(--faint); }
.gp-spec-credit { font-size: 12px; color: var(--faint); margin-top: 12px; line-height: 1.9; }
.gp-spec-credit a { border-bottom: 1px dotted currentColor; }

/* 阅读提示 */
.gp-primer {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 44px);
  padding-block: clamp(44px, 6vw, 80px);
}
.gp-primer > div { border-top: 1px dotted var(--line); padding-top: 18px; }
.gp-primer-no { font-family: var(--font-serif); font-size: 14px; color: var(--accent-deep); letter-spacing: .1em; }
.gp-primer h2 { font-size: 19px; margin-block: 8px 8px; }
.gp-primer p { font-size: 14px; color: var(--muted); }

/* 目录 */
.gp-cat-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; border-top: 1px dotted var(--line); padding-top: clamp(36px, 5vw, 60px);
  margin-bottom: 24px;
}
.gp-cat-head h2 { font-family: var(--font-serif); font-size: clamp(28px, 3.6vw, 40px); }
.gp-learned-line { font-size: 14px; color: var(--muted); }
.gp-learned-line strong { font-family: var(--font-serif); font-size: 20px; color: var(--ink); }
.gp-learned-line a { border-bottom: 1px dotted var(--ink); }

.gp-tools {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 12px;
  margin-bottom: 16px;
}
.gp-search {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); background: var(--surface); padding: 0 16px;
  border-radius: 999px; height: 48px; color: var(--muted);
}
.gp-search:focus-within { border-color: var(--ink); }
.gp-search input { flex: 1; border: 0; background: none; font: inherit; font-size: 15px; color: var(--ink); height: 100%; }
.gp-search input:focus { outline: none; }
.gp-select { display: grid; gap: 4px; font-size: 11.5px; letter-spacing: .1em; color: var(--faint); }
.gp-select select {
  font: inherit; font-size: 14px; color: var(--ink);
  border: 1px solid var(--line); background: var(--surface);
  height: 48px; padding: 0 12px; border-radius: 12px; width: 100%;
}
.gp-select select:focus { outline: none; border-color: var(--ink); }

.gp-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-block: 10px 4px; }
#gem-result-count { font-size: 14px; color: var(--muted); }
.gp-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gp-bar-actions button {
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 15px; font-size: 13px;
  transition: all .25s var(--ease);
}
.gp-bar-actions button:hover { border-color: var(--ink); }
.gp-bar-actions button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.gp-note { font-size: 12px; color: var(--faint); margin-top: 6px; }

/* 卡片网格 */
.gp-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 22px);
  margin-top: 24px;
}
.gem-card {
  border: 1px solid var(--line); background: var(--surface);
  display: grid; grid-template-rows: 1fr auto;
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.gem-card:hover { border-color: var(--ink); transform: translateY(-3px); }
.gem-card[hidden] { display: none; }
.gc-open { display: grid; text-align: left; }
.gc-art {
  display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background:
    radial-gradient(120% 90% at 20% 0%, color-mix(in srgb, var(--gem-color) 16%, var(--surface)), var(--surface) 70%);
}
.gc-art svg { width: 100%; height: 100%; }
.gc-no {
  position: absolute; top: 10px; left: 12px;
  font-family: var(--font-serif); font-size: 13px; color: var(--faint); letter-spacing: .08em;
}
.ga-real { display: block; position: relative; width: 100%; height: 100%; }
.ga-real img { width: 100%; height: 100%; object-fit: cover; }
.ga-badge {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(23, 20, 15, .8); color: var(--dark-ink);
  font-size: 11.5px; padding: 4px 10px; border-radius: 999px;
}
.gc-body { display: grid; gap: 3px; padding: 14px 16px 12px; }
.gc-family { font-size: 11px; letter-spacing: .14em; color: var(--accent-deep); }
.gc-name { font-family: var(--font-serif); font-size: 19px; color: var(--ink); }
.gc-en { font-size: 12.5px; color: var(--faint); }
.gc-summary {
  font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gc-hard { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.gc-hard strong { color: var(--ink); }
.gc-actions { display: flex; border-top: 1px dotted var(--line); }
.gc-actions button {
  flex: 1; padding: 10px 6px; font-size: 13px; color: var(--muted);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.gc-actions button + button { border-left: 1px dotted var(--line); }
.gc-actions button:hover { color: var(--ink); background: rgba(33, 29, 24, .04); }
.gc-actions button[aria-pressed="true"] { color: var(--accent-deep); font-weight: 600; }

#gem-more { display: block; margin: 34px auto 0; }
#gem-more[hidden] { display: none; }
#gem-empty { text-align: center; padding: 60px 0 30px; }
#gem-empty h3 { font-family: var(--font-serif); font-size: 24px; margin-bottom: 10px; }
#gem-empty p { color: var(--muted); margin-bottom: 18px; }
#gem-empty button { border-bottom: 1px solid var(--ink); padding-bottom: 2px; }

/* 学习记录 */
.gp-learning { padding-block: clamp(48px, 7vw, 90px); border-top: 1px dotted var(--line); margin-top: clamp(48px, 6vw, 80px); }
.gp-learning > header { margin-bottom: 28px; }
.gp-learning h2 { font-family: var(--font-serif); font-size: clamp(28px, 3.6vw, 40px); margin-bottom: 8px; }
.gp-learning > header p:not(.eyebrow) { color: var(--muted); }
.gl-layout { display: grid; grid-template-columns: 300px 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.gl-progress { border: 1px solid var(--line); background: var(--surface); padding: 22px; display: grid; gap: 14px; position: sticky; top: 90px; }
.gl-count { font-size: 14px; color: var(--muted); }
.gl-count strong { font-family: var(--font-serif); font-size: 26px; color: var(--ink); }
#gem-progress { width: 100%; height: 6px; appearance: none; }
#gem-progress::-webkit-progress-bar { background: rgba(33, 29, 24, .1); border-radius: 3px; }
#gem-progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
#gem-progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }
#gem-progress-note { font-size: 13px; color: var(--muted); }
.gl-storage { font-size: 12px; color: var(--faint); line-height: 1.8; }
#gem-storage-warning { font-size: 13px; color: var(--accent-deep); }
.gl-empty { color: var(--faint); font-size: 14px; padding: 30px 0; line-height: 2; }
.gl-item { border-top: 1px dotted var(--line); padding: 16px 0; display: grid; gap: 6px; }
.gl-item-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.gl-item-head strong { font-family: var(--font-serif); font-size: 18px; }
.gl-item-head span { font-size: 12.5px; color: var(--faint); }
.gl-item-head .gl-known { color: var(--dot-daily); font-size: 12px; letter-spacing: .1em; }
.gl-item-note { font-size: 14px; color: var(--muted); white-space: pre-wrap; line-height: 1.9; }
.gl-item-actions { display: flex; gap: 16px; font-size: 13px; }
.gl-item-actions button, .gl-item-actions a { color: var(--ink); border-bottom: 1px dotted var(--ink); }

/* 阅读说明 */
.gp-reading {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(24px, 4vw, 64px);
  border-top: 1px dotted var(--line); padding-top: clamp(40px, 6vw, 72px);
}
.gp-reading h2 { font-family: var(--font-serif); font-size: clamp(26px, 3.4vw, 38px); }
.gp-reading > div:last-child p { color: var(--muted); margin-bottom: 14px; font-size: 15px; }
.gp-reading details { border-top: 1px dotted var(--line); padding-top: 14px; margin-top: 8px; }
.gp-reading summary { cursor: pointer; font-size: 15px; }
.gp-reading details p, .gp-reading details li { font-size: 14px; }
.gp-reading ul { margin: 10px 0 10px 20px; color: var(--muted); }
.gp-reading a { border-bottom: 1px dotted var(--ink); }

/* 对比栏 */
.gp-compare-bar[hidden] { display: none; }
.gp-compare-bar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px; z-index: 150;
  background: var(--ink); color: var(--paper); border-radius: 999px;
  padding: 10px 12px 10px 22px; font-size: 14px;
  box-shadow: 0 18px 44px -18px rgba(23, 20, 15, .55); max-width: 92vw;
}
#gem-compare-names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-compare-bar button {
  border: 1px solid rgba(242, 239, 233, .4); border-radius: 999px;
  padding: 7px 16px; font-size: 13px; color: var(--paper); white-space: nowrap;
  transition: all .2s var(--ease);
}
.gp-compare-bar button:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* 对话框 */
.gp-dialog {
  border: 0; padding: 0; background: var(--paper); color: var(--ink);
  width: min(880px, 94vw); max-width: 94vw; max-height: 90vh;
  margin: auto; overflow: hidden; display: grid; grid-template-rows: auto 1fr;
}
.gp-dialog::backdrop { background: rgba(23, 20, 15, .55); }
.gp-compare-dialog { width: min(1020px, 96vw); }
.gp-dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 22px; border-bottom: 1px dotted var(--line);
  font-size: 12px; letter-spacing: .18em; color: var(--muted);
}
.gp-dialog-head h2 { font-family: var(--font-serif); font-size: 22px; letter-spacing: 0; color: var(--ink); }
.gp-dialog-head button { font-size: 14px; letter-spacing: 0; border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; }
.gp-dialog-head button:hover { border-color: var(--ink); }
#gem-detail-content, #gem-comparison { overflow-y: auto; padding: 24px 22px 30px; min-height: 0; }

/* 详情内容 */
.gd-hero { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.gd-art { border: 1px solid var(--line); background: var(--surface); }
.gd-art svg, .gd-art img { width: 100%; display: block; }
.gd-head h2 { font-family: var(--font-serif); font-size: 32px; }
.gd-head .gd-en { color: var(--faint); font-size: 15px; margin-bottom: 10px; }
.gd-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-block: 10px 14px; }
.gd-tags span {
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
  font-size: 12px; color: var(--muted);
}
.gd-summary { font-size: 15px; line-height: 1.9; }
.gd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; margin-top: 22px; }
.gd-field { border-top: 1px dotted var(--line); padding: 12px 0; }
.gd-field dt { font-size: 11.5px; letter-spacing: .16em; color: var(--faint); margin-bottom: 5px; }
.gd-field dd { font-size: 14.5px; line-height: 1.85; }
.gd-field a { border-bottom: 1px dotted var(--ink); word-break: break-all; }
.gd-specimen { margin-top: 22px; border: 1px solid var(--line); background: var(--surface); padding: 16px; }
.gd-specimen img { width: 100%; margin-block: 10px; }
.gd-specimen h3 { font-size: 16px; }
.gd-specimen p { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.9; }
.gd-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.gd-btn {
  border: 1px solid var(--ink); border-radius: 999px; padding: 9px 20px; font-size: 14px;
  transition: all .25s var(--ease);
}
.gd-btn:hover { background: var(--ink); color: var(--paper); }
.gd-btn-quiet { border-color: var(--line); }
.gd-btn-quiet:hover { border-color: var(--ink); }
.gd-note { margin-top: 26px; border-top: 1px dotted var(--line); padding-top: 18px; }
.gd-note h3 { font-size: 15px; margin-bottom: 4px; }
.gd-note p { font-size: 12.5px; color: var(--faint); margin-bottom: 10px; }
.gd-note textarea {
  width: 100%; min-height: 110px; font: inherit; font-size: 14.5px; line-height: 1.9;
  border: 1px solid var(--line); background: var(--surface); padding: 12px 14px;
  border-radius: 8px; resize: vertical; color: var(--ink);
}
.gd-note textarea:focus { outline: none; border-color: var(--ink); }
.gd-note-status { font-size: 12.5px; color: var(--faint); margin-top: 6px; min-height: 1.2em; }

/* 对比表 */
.gc-table-wrap { overflow-x: auto; }
.gc-table { border-collapse: collapse; width: 100%; min-width: 560px; }
.gc-table th, .gc-table td {
  border-bottom: 1px dotted var(--line); padding: 10px 14px 10px 0;
  text-align: left; vertical-align: top; font-size: 14px; line-height: 1.8;
}
.gc-table thead th { border-bottom: 1px solid var(--line); }
.gc-table thead .gc-table-art { width: 90px; }
.gc-table thead svg { width: 90px; height: 68px; }
.gc-table thead img { width: 90px; height: 60px; object-fit: cover; }
.gc-table .ga-badge, .gc-table .gc-no { display: none; }
.gc-table .gc-row-label { font-size: 11.5px; letter-spacing: .14em; color: var(--faint); white-space: nowrap; padding-right: 18px; }
.gc-table .gc-name-cell strong { font-family: var(--font-serif); font-size: 18px; display: block; }
.gc-table .gc-name-cell span { font-size: 12px; color: var(--faint); }

@media (max-width: 1000px) {
  .gp-grid { grid-template-columns: repeat(3, 1fr); }
  .gp-tools { grid-template-columns: 1fr 1fr; }
  .gp-search { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .gp-hero { grid-template-columns: 1fr; }
  .gp-primer { grid-template-columns: 1fr; gap: 22px; }
  .gl-layout { grid-template-columns: 1fr; }
  .gl-progress { position: static; }
  .gp-reading { grid-template-columns: 1fr; }
  .gd-hero { grid-template-columns: 1fr; }
  .gd-art { max-width: 260px; }
}
@media (max-width: 620px) {
  .gp-grid { grid-template-columns: repeat(2, 1fr); }
  .gd-grid { grid-template-columns: 1fr; }
  .gp-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; }
  .gp-compare-bar { bottom: 12px; gap: 8px; padding-left: 16px; font-size: 13px; }
}
@media (max-width: 340px) {
  .gp-grid { grid-template-columns: 1fr; }
  .gp-tools { grid-template-columns: 1fr; }
}
