/* ===== 基础 ===== */
:root {
  --bg: #f7f5f1;
  --bg-soft: #efece5;
  --card: #ffffff;
  --ink: #191922;
  --ink-2: #4a4a57;
  --ink-3: #8b8b98;
  --line: #e6e2da;
  --line-2: #d8d3c8;
  --accent: #e0402f;
  --accent-soft: #fdecea;
  --blue: #2f5bea;
  --green: #1f9d63;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(25, 25, 34, .04), 0 18px 40px -24px rgba(25, 25, 34, .28);
}

* { box-sizing: border-box; }

/* 保证 hidden 属性始终生效（否则会被 display:flex/grid 覆盖） */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

/* ===== 顶栏 ===== */
.topbar {
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: .2px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}

.brand-name { font-size: 15px; }

.top-link {
  font-size: 13.5px;
  color: var(--ink-3);
  padding: 7px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  transition: .18s;
  background: transparent;
}
.top-link:hover { color: var(--ink); border-color: var(--ink); }

/* ===== 布局 ===== */
.shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 64px;
}

.hero {
  padding: 36px 4px 26px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 38px;
  line-height: 1.25;
  letter-spacing: -.8px;
  font-weight: 800;
}

.hero p {
  margin: 0;
  color: var(--ink-2);
  font-size: 15.5px;
  max-width: 46em;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.chip {
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-2);
  border: 1px solid transparent;
  white-space: nowrap;
}

.chip-ghost { background: transparent; border-color: var(--line-2); }

.chip-live {
  background: #e9f7f0;
  color: var(--green);
  font-weight: 600;
}

.chip-live.closed { background: var(--accent-soft); color: var(--accent); }

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 28px;
}

.notice {
  background: #fdf8ec;
  border: 1px solid #f0e2c2;
  color: #7a5c17;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 22px;
}

/* ===== 字段 ===== */
.fields { display: flex; flex-direction: column; gap: 26px; }

.field-label {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-weight: 650;
  font-size: 15.5px;
  margin-bottom: 4px;
}

.idx {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  flex: 0 0 auto;
  transform: translateY(1px);
}

.field-opt {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  background: var(--bg-soft);
  padding: 1px 8px;
  border-radius: 999px;
}

.field-hint {
  font-size: 13px;
  color: var(--ink-3);
  margin: 2px 0 9px;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  font: inherit;
  font-size: 15.5px;
  color: var(--ink);
  background: #fbfaf8;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color .16s, background .16s, box-shadow .16s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

textarea { min-height: 96px; resize: vertical; line-height: 1.6; }

input:focus, textarea:focus, select:focus {
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(25, 25, 34, .06);
}

input::placeholder, textarea::placeholder { color: #b3b0a8; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b8b98' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 38px;
}

.err-text {
  color: var(--accent);
  font-size: 13px;
  margin-top: 7px;
  display: none;
}

.field.invalid input,
.field.invalid textarea,
.field.invalid select { border-color: var(--accent); background: var(--accent-soft); }

.field.invalid .err-text { display: block; }

/* 选项组 */
.choices { display: flex; flex-wrap: wrap; gap: 10px; }

.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fbfaf8;
  cursor: pointer;
  font-size: 15px;
  transition: .16s;
  user-select: none;
}

.choice:hover { border-color: var(--line-2); }

.choice input { position: absolute; opacity: 0; pointer-events: none; }

.choice .dotmark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
  transition: .16s;
}

.choice.square .dotmark { border-radius: 5px; }

.choice input:checked ~ .dotmark { border-color: var(--ink); background: var(--ink); }

.choice input:checked ~ .dotmark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.choice.square input:checked ~ .dotmark::after {
  width: 8px; height: 4px; border-radius: 0;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  background: transparent;
  transform: translate(-50%, -60%) rotate(-45deg);
}

.choice input:checked ~ .choice-text { font-weight: 600; }

.choice:has(input:checked) { border-color: var(--ink); background: #fff; }

/* ===== 上传 ===== */
.uploader {
  border: 1.5px dashed var(--line-2);
  border-radius: 14px;
  padding: 18px;
  background: #fbfaf8;
  transition: .16s;
  cursor: pointer;
}

.uploader:hover, .uploader.drag {
  border-color: var(--ink);
  background: #fff;
}

.uploader .up-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-3);
  font-size: 14px;
}

.up-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--bg-soft);
  display: grid; place-items: center;
  font-size: 17px;
  color: var(--ink-2);
  flex: 0 0 auto;
}

.up-empty b { color: var(--ink-2); font-weight: 600; display: block; font-size: 14.5px; }

.previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 11px;
  margin-top: 2px;
}

.pv {
  position: relative;
  border-radius: 11px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

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

.pv-audio { padding: 10px 10px 8px; }
.pv-audio .fname { font-size: 11.5px; color: var(--ink-2); word-break: break-all; line-height: 1.4; margin-bottom: 6px; }
.pv-audio audio { width: 100%; height: 30px; }

.pv-del {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 20, 26, .62);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  backdrop-filter: blur(4px);
}
.pv-del:hover { background: var(--accent); }

.previews:not(:empty) + .up-empty { display: none; }

/* ===== 重复组 ===== */
.repeat-list { display: flex; flex-direction: column; gap: 12px; }

.repeat-item {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px;
  background: #fbfaf8;
  position: relative;
}

.repeat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.repeat-head span {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: .4px;
}

.repeat-del {
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.repeat-del:hover { color: var(--accent); background: var(--accent-soft); }

.repeat-sub {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sub-label {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: 4px;
  display: block;
}

.repeat-item input { background: #fff; padding: 9px 12px; font-size: 14.5px; border-radius: 10px; }

.repeat-item.invalid { border-color: var(--accent); }

.add-item {
  margin-top: 11px;
  width: 100%;
  padding: 10px;
  border: 1.5px dashed var(--line-2);
  background: transparent;
  border-radius: 12px;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: .16s;
}
.add-item:hover { border-color: var(--ink); color: var(--ink); }
.add-item:disabled { opacity: .4; cursor: not-allowed; }

/* ===== 按钮 ===== */
.actions { margin-top: 30px; }

.btn {
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  border: none;
  border-radius: 13px;
  padding: 14px 22px;
  cursor: pointer;
  transition: .18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  width: 100%;
  background: var(--ink);
  color: #fff;
  letter-spacing: .3px;
}

.btn-primary:hover { background: #000; transform: translateY(-1px); box-shadow: 0 10px 24px -12px rgba(0,0,0,.6); }

.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--line-2);
  color: var(--ink-2);
}
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

.fineprint {
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
  margin: 12px 0 0;
}

.req-dot { color: var(--accent); font-style: normal; }

.form-err {
  color: var(--accent);
  font-size: 14px;
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 11px 14px;
  margin: 20px 0 0;
}

/* ===== 成功页 ===== */
.success { text-align: center; padding: 44px 28px; }

.check {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: #e9f7f0;
  color: var(--green);
  font-size: 26px;
  display: grid; place-items: center;
  margin: 0 auto 18px;
}

.success h2 { margin: 0 0 8px; font-size: 24px; font-weight: 750; }

.success-msg { color: var(--ink-2); font-size: 15px; margin: 0 auto 22px; max-width: 30em; }

.success-box {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-soft);
  border-radius: 13px;
  padding: 14px 30px;
  margin-bottom: 8px;
}

.success-box span { font-size: 12.5px; color: var(--ink-3); }

.success-box strong { font-size: 26px; letter-spacing: 1px; font-variant-numeric: tabular-nums; }

.group-line { color: var(--green); font-size: 15px; font-weight: 600; margin: 10px 0 22px; }

/* ===== 页脚 ===== */
.foot {
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
  margin-top: 30px;
}
.foot .dot { margin: 0 7px; }
.foot a:hover { color: var(--ink); text-decoration: underline; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(14px);
  background: var(--ink);
  color: #fff;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  transition: .25s;
  z-index: 99;
  max-width: 88vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 移动端 ===== */
@media (max-width: 640px) {
  .topbar { height: 56px; padding: 0 16px; }
  .shell { padding: 8px 14px 48px; }
  .hero { padding: 22px 4px 20px; }
  .hero h1 { font-size: 27px; letter-spacing: -.4px; }
  .hero p { font-size: 14.5px; }
  .card { padding: 20px 16px; border-radius: 16px; }
  .fields { gap: 22px; }
  .repeat-sub { grid-template-columns: 1fr; gap: 8px; }
  .field-label { font-size: 15px; }
  .btn-primary { padding: 15px; font-size: 16px; }
  .success { padding: 34px 18px; }
}
