* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: #EFE9DE;
  color: #2C2C2A;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper, #F6F1E7);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
}

.view { display: none; }
.view.active { display: block; animation: fade 0.4s ease both; }

@keyframes fade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.serif { font-family: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "SimSun", serif; }

.pad { padding: 28px 26px; }

.kicker {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--accent, #9C3A2E);
  margin-bottom: 14px;
}

h1.title {
  font-size: 38px;
  line-height: 1.25;
  margin: 0 0 14px;
  font-weight: 500;
}

.lead { color: #5F5E5A; font-size: 15px; margin: 0 0 24px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.chip {
  font-size: 12px;
  color: #5F5E5A;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  padding: 5px 12px;
}

.cover-art {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 26px 22px;
  margin-bottom: 28px;
  background: rgba(255, 255, 255, 0.5);
}

.cover-art .big {
  font-size: 44px;
  line-height: 1.3;
  margin: 0 0 10px;
  font-weight: 500;
}

.cover-art .sub { font-size: 14px; color: #6B6862; margin: 0; }

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 16px;
  font-family: inherit;
  color: #fff;
  background: var(--accent, #9C3A2E);
  cursor: pointer;
}

.btn.ghost {
  background: transparent;
  color: var(--accent, #9C3A2E);
  border: 1px solid rgba(0, 0, 0, 0.15);
  margin-top: 10px;
}

.btn:active { opacity: 0.85; }

.disclaimer { font-size: 12px; color: #888780; margin-top: 18px; text-align: center; }

/* 答题 */
.topbar {
  position: sticky;
  top: 0;
  background: var(--paper, #F6F1E7);
  padding: 18px 26px 10px;
  z-index: 5;
}

.qcount { font-size: 12px; color: #888780; display: flex; justify-content: space-between; }

.bar {
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--accent, #9C3A2E);
  width: 0;
  transition: width 0.35s ease;
}

.question {
  font-size: 21px;
  line-height: 1.6;
  margin: 26px 0 22px;
  font-weight: 500;
}

.opts { display: flex; flex-direction: column; gap: 12px; }

.opt {
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  padding: 15px 16px;
  font-size: 15px;
  font-family: inherit;
  color: #2C2C2A;
  line-height: 1.6;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.opt:active { border-color: var(--accent, #9C3A2E); background: #fff; }

/* 加载 */
.loading { text-align: center; padding: 120px 30px; }

.loading .ring {
  width: 46px;
  height: 46px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top-color: var(--accent, #9C3A2E);
  border-radius: 50%;
  margin: 0 auto 26px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading .tip { font-size: 16px; color: #5F5E5A; min-height: 26px; }

/* 结果 */
.res-head { padding: 34px 26px 20px; }

.res-pct { font-size: 56px; font-weight: 500; color: var(--accent, #9C3A2E); line-height: 1; }
.res-pct small { font-size: 20px; margin-left: 4px; }
.res-plabel { font-size: 13px; color: #888780; margin-bottom: 18px; }
.res-name { font-size: 44px; margin: 0 0 6px; font-weight: 500; }
.res-era { font-size: 14px; color: #6B6862; margin: 0 0 16px; }
.res-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.res-tags span {
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: #4A4842;
}

.sec { padding: 22px 26px; border-top: 1px solid rgba(0, 0, 0, 0.08); }

.sec h3 {
  font-size: 15px;
  margin: 0 0 12px;
  color: var(--accent, #9C3A2E);
  font-weight: 500;
  letter-spacing: 1px;
}

.sec p { font-size: 15px; color: #3A3A38; margin: 0; }

.dims { display: flex; flex-direction: column; gap: 11px; }
.dim { display: flex; align-items: center; gap: 10px; }
.dim .n { width: 34px; font-size: 14px; color: #444441; flex: none; }
.dim .track { flex: 1; height: 8px; background: rgba(0, 0, 0, 0.08); border-radius: 4px; overflow: hidden; }
.dim .fill { display: block; height: 100%; background: var(--accent, #9C3A2E); border-radius: 4px; width: 0; transition: width 0.9s ease; }
.dim .v { width: 30px; text-align: right; font-size: 14px; color: #5F5E5A; flex: none; }

.quotes { list-style: none; margin: 0; padding: 0; }
.quotes li { font-size: 15px; padding: 10px 0 10px 16px; border-left: 2px solid var(--accent, #9C3A2E); margin-bottom: 10px; color: #3A3A38; }

.runner { display: flex; justify-content: space-between; font-size: 14px; padding: 9px 0; border-bottom: 1px dashed rgba(0, 0, 0, 0.12); color: #4A4842; }
.runner:last-child { border: none; }

.actions { padding: 10px 26px 40px; }

/* 长图浮层 */
#overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  z-index: 50;
  display: none;
  overflow-y: auto;
  padding: 20px 0 40px;
}

#overlay.on { display: block; }
#overlay img { width: 100%; display: block; }
#overlay .hint { color: #fff; text-align: center; font-size: 13px; padding: 0 0 16px; }
#overlay .close {
  display: block;
  margin: 0 auto 14px;
  background: rgba(255, 255, 255, 0.16);
  border: none;
  color: #fff;
  padding: 9px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-family: inherit;
}

/* 主题封面列表 */
.theme-card {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.theme-card h4 { margin: 0 0 4px; font-size: 19px; font-weight: 500; }
.theme-card p { margin: 0; font-size: 13px; color: #6B6862; }

/* 访问验证门 */
.gate {
  max-width: 340px;
  margin: 8vh auto 0;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 22px;
  padding: 34px 26px 30px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.07);
}
.gate-icon {
  width: 58px; height: 58px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--accent, #9C3A2E);
  color: #fff;
  font-size: 26px;
  display: flex; align-items: center; justify-content: center;
}
.gate-kicker { font-size: 11px; letter-spacing: 4px; color: #8A857C; margin-bottom: 6px; }
.gate-title { margin: 0 0 10px; font-size: 24px; font-weight: 600; }
.gate-desc { font-size: 13px; color: #6B6862; line-height: 1.7; margin: 0 0 20px; }
#gate-code {
  width: 100%;
  border: 1.5px solid rgba(0, 0, 0, 0.18);
  border-radius: 12px;
  background: #fff;
  font-size: 24px;
  letter-spacing: 10px;
  text-align: center;
  padding: 12px 8px;
  outline: none;
  font-family: inherit;
}
#gate-code:focus { border-color: var(--accent, #9C3A2E); }
.gate-error { min-height: 18px; font-size: 12px; color: #C0392B; margin: 10px 0 4px; }
.gate.shake { animation: gate-shake 0.4s; }
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* 桌面提示 */
#desktop {
  display: none;
  position: absolute;
  inset: 0;
  background: #EFE9DE;
  z-index: 90;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
}

#desktop .box { max-width: 380px; }
#desktop h2 { font-size: 22px; font-weight: 500; margin: 0 0 12px; }
#desktop p { font-size: 14px; color: #5F5E5A; }

@media (min-width: 768px) {
  #desktop { display: flex; }
}
