/* 十二试炼 —— 古典羊皮纸风格
   目标：手机上好看、易读、不花哨。不用任何外部字体或 CDN，
   因为她可能在弱网下打开，加载不出来就等于没做。 */

:root {
  --ink: #2a2219;
  --ink-soft: #5a4d3c;
  --ink-faint: #8a7c66;
  --parchment: #f4ecdc;
  --parchment-2: #ebe0c9;
  --gold: #a67c2e;
  --gold-bright: #c9a227;
  --blood: #7a2e26;
  --shadow: 0 1px 2px rgba(42, 34, 25, .12), 0 4px 16px rgba(42, 34, 25, .08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--parchment);
  /* 极淡的纸纹：两层径向渐变，比图片省流 */
  background-image:
    radial-gradient(circle at 20% 30%, rgba(166, 124, 46, .05) 0, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(122, 46, 38, .04) 0, transparent 45%);
  color: var(--ink);
  font-family: "Georgia", "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  font-size: 16px;
  line-height: 1.75;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ---- 页头 ---- */

.masthead {
  text-align: center;
  padding: 40px 0 28px;
}

.masthead h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink);
}

.masthead .sub {
  margin-top: 8px;
  font-size: 13px;
  letter-spacing: .16em;
  color: var(--ink-faint);
}

.rule {
  height: 1px;
  margin: 20px auto;
  max-width: 200px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ---- 进度 ---- */

.progress-line {
  text-align: center;
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.progress-bar {
  height: 3px;
  max-width: 280px;
  margin: 0 auto 32px;
  background: var(--parchment-2);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width .5s ease;
}

/* ---- 关卡列表 ---- */

.trials { list-style: none; margin: 0; padding: 0; }

.trial {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 18px 18px 16px;
  margin-bottom: 10px;
  background: rgba(255, 253, 247, .72);
  border: 1px solid rgba(166, 124, 46, .22);
  border-radius: 3px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.trial:hover, .trial:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(166, 124, 46, .5);
  box-shadow: 0 2px 4px rgba(42, 34, 25, .12), 0 8px 24px rgba(42, 34, 25, .1);
}

.trial.done { background: rgba(240, 236, 222, .6); }

.trial .num {
  flex: 0 0 46px;
  font-size: 15px;
  letter-spacing: .08em;
  color: var(--gold);
  padding-top: 2px;
  text-align: center;
}

.trial.done .num { color: var(--ink-faint); }

.trial .body { flex: 1 1 auto; min-width: 0; }

.trial .name {
  font-size: 17px;
  color: var(--ink);
  line-height: 1.4;
}

.trial .myth {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-faint);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trial .mark {
  flex: 0 0 auto;
  align-self: center;
  font-size: 18px;
  color: var(--gold);
}

.trial.done .mark { color: var(--ink-faint); }

.seal {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 10px;
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--blood);
  border: 1px solid rgba(122, 46, 38, .35);
  border-radius: 2px;
  transform: rotate(-1.5deg);
}

/* ---- 详情页 ---- */

.back {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--ink-faint);
  text-decoration: none;
}

.back:hover { color: var(--gold); }

.detail-num {
  font-size: 12px;
  letter-spacing: .28em;
  color: var(--gold);
  text-transform: uppercase;
}

.detail-title {
  margin: 6px 0 0;
  font-size: 27px;
  font-weight: 400;
  line-height: 1.35;
}

.myth {
  margin: 20px 0 0;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-soft);
  background: rgba(235, 224, 201, .5);
  border-left: 2px solid var(--gold);
  border-radius: 0 3px 3px 0;
}

.section-label {
  margin: 34px 0 10px;
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.task {
  font-size: 16.5px;
  line-height: 1.85;
}

.proof {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-soft);
  padding-left: 14px;
  border-left: 2px solid rgba(166, 124, 46, .3);
}

/* ---- 表单 ---- */

form { margin: 0; }

textarea, input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink);
  background: rgba(255, 253, 247, .9);
  border: 1px solid rgba(166, 124, 46, .3);
  border-radius: 3px;
  resize: vertical;
}

textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(166, 124, 46, .1);
}

textarea { min-height: 120px; }

.file-hint {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-faint);
  line-height: 1.6;
}

input[type="file"] {
  width: 100%;
  margin-top: 10px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink-soft);
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--parchment-2);
  border: 1px solid rgba(166, 124, 46, .35);
  border-radius: 2px;
  cursor: pointer;
}

button {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 30px;
  font-family: inherit;
  font-size: 14.5px;
  letter-spacing: .1em;
  color: #fffdf7;
  background: var(--blood);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background .15s ease;
}

button:hover { background: #8f3a30; }
button:active { transform: translateY(1px); }

button.ghost {
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid rgba(166, 124, 46, .35);
}

button.ghost:hover { background: rgba(235, 224, 201, .6); }

/* ---- 提交记录 ---- */

.submission {
  padding: 16px 18px;
  margin-bottom: 12px;
  background: rgba(255, 253, 247, .7);
  border: 1px solid rgba(166, 124, 46, .18);
  border-radius: 3px;
}

.submission .when {
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ink-faint);
}

.submission .text {
  margin-top: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.gallery a {
  display: block;
  aspect-ratio: 1;
  border-radius: 2px;
  overflow: hidden;
  background: var(--parchment-2);
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- 反馈 ---- */

.feedback {
  position: relative;
  padding: 16px 18px 16px 20px;
  margin-bottom: 12px;
  background: rgba(250, 246, 234, .85);
  border-left: 2px solid var(--gold);
  border-radius: 0 3px 3px 0;
}

.feedback .who {
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--gold);
}

.feedback .when {
  font-size: 12px;
  color: var(--ink-faint);
  margin-left: 8px;
}

.feedback .text {
  margin-top: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.reward {
  padding: 18px;
  margin: 24px 0;
  text-align: center;
  background: linear-gradient(135deg, rgba(201, 162, 39, .1), rgba(166, 124, 46, .04));
  border: 1px solid rgba(166, 124, 46, .35);
  border-radius: 3px;
}

.reward .label {
  font-size: 11.5px;
  letter-spacing: .22em;
  color: var(--gold);
  text-transform: uppercase;
}

.reward .body {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.7;
}

/* ---- 提示条 ---- */

.notice {
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 14px;
  border-radius: 3px;
}

.notice.ok {
  color: #3d4a2e;
  background: rgba(126, 154, 92, .13);
  border: 1px solid rgba(126, 154, 92, .3);
}

.notice.err {
  color: var(--blood);
  background: rgba(122, 46, 38, .07);
  border: 1px solid rgba(122, 46, 38, .25);
}

/* ---- 空状态 ---- */

.empty {
  padding: 28px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-faint);
  line-height: 1.8;
}

/* ---- 锁屏页 ---- */

.locked {
  max-width: 380px;
  margin: 18vh auto 0;
  padding: 0 24px;
  text-align: center;
}

.locked p { color: var(--ink-soft); font-size: 15px; line-height: 1.9; }

/* ---- 后台表格 ---- */

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 10px 8px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid rgba(166, 124, 46, .16);
}

th {
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--ink-faint);
  font-weight: 400;
  text-transform: uppercase;
}

td a { color: var(--ink); text-decoration: none; border-bottom: 1px solid rgba(166,124,46,.4); }
td a:hover { color: var(--gold); }

.badge {
  display: inline-block;
  padding: 1px 8px;
  font-size: 11.5px;
  border-radius: 2px;
}

.badge.ok { color: #3d4a2e; background: rgba(126, 154, 92, .18); }
.badge.wait { color: var(--ink-faint); background: rgba(166, 124, 46, .12); }

/* ---- 页脚 ---- */

.foot {
  margin-top: 56px;
  text-align: center;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--ink-faint);
}

/* ---- 小屏 ---- */

@media (max-width: 480px) {
  body { font-size: 15.5px; }
  .wrap { padding: 0 16px 64px; }
  .masthead { padding: 30px 0 22px; }
  .masthead h1 { font-size: 24px; letter-spacing: .16em; }
  .trial { padding: 15px 14px; gap: 12px; }
  .trial .num { flex-basis: 38px; font-size: 14px; }
  .trial .name { font-size: 16px; }
  .detail-title { font-size: 23px; }
  button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
