:root {
  --ink: #231c16;
  --muted: #7a7066;
  --line: #e6ddd2;
  --bg: #f3eee6;
  --card: #fffcf8;
  --accent: #c4512c;
  --deep: #8c3118;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: #e4ddd2; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.phone {
  width: min(480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
}

#view { padding: 20px 16px 28px; }
#view.tabbed { padding-bottom: 96px; }
#view.docked { padding-bottom: 108px; }

.hero { display: flex; align-items: center; gap: 12px; }
.seal {
  width: 48px; height: 48px; flex: none;
  border: 2px solid var(--accent); color: var(--accent);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; transform: rotate(-8deg);
}
.hero h1 { margin: 0; font-size: 28px; line-height: 1.15; }
.kicker { color: var(--deep); font-size: 13px; letter-spacing: 1px; }
.quota {
  margin-left: auto; background: var(--ink); color: var(--card);
  border-radius: 999px; padding: 6px 10px; font-size: 12px; white-space: nowrap;
}

.card {
  background: var(--card); border-radius: 18px; padding: 16px; margin-top: 14px;
}
.shop-name { font-size: 22px; font-weight: 700; margin: 4px 0; }
.muted { color: var(--muted); font-size: 14px; }
.link { color: var(--accent); font-size: 14px; margin-top: 8px; }

.section { margin: 22px 0 4px; color: var(--muted); font-size: 13px; }
.feature {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 18px; padding: 14px; margin-top: 10px;
}
.fno { width: 32px; color: var(--accent); font-weight: 700; }
.fbody { flex: 1; }
.fname { font-weight: 650; }
.fdesc { color: var(--muted); font-size: 13px; }
.faction { color: var(--deep); font-size: 14px; }

.topbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.topbar h1 { font-size: 22px; margin: 0; }
.back {
  border: 0; background: transparent; color: var(--deep);
  padding: 6px 0; font-size: 15px;
}

label.field { display: block; margin-top: 16px; color: var(--muted); font-size: 13px; }
input[type="text"], input[type="url"], textarea, select, .picker {
  width: 100%; margin-top: 6px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  font-size: 16px;
}
textarea { min-height: 110px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 8px 12px; font-size: 14px;
}
.chip.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-top: 12px; }
.filters .chip { flex: none; }

.lead { color: var(--muted); font-size: 14px; }
.tag {
  display: inline-block; font-size: 12px; color: var(--deep); background: #f8e7d4;
  border-radius: 999px; padding: 2px 8px; margin-right: 6px;
}
.tag.plain { color: var(--ink); background: #f3eee6; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.preview { margin-top: 6px; color: var(--muted); font-size: 14px; }

.stamp {
  display: inline-flex; align-items: center; height: 28px; padding: 0 10px;
  border-radius: 999px; background: var(--card); color: var(--accent);
  font-size: 12px; font-weight: 700;
}
.paper { white-space: pre-wrap; }
.note { margin-top: 10px; color: var(--muted); font-size: 13px; }
.mock { color: var(--deep); }
.poster { margin-top: 12px; border-radius: 18px; width: 100%; }
.shot-h, .script-title { font-weight: 700; }
.line { margin-top: 8px; }
.key { color: var(--deep); margin-right: 6px; }
.title-row { display: flex; align-items: center; gap: 8px; }
.title-row p { flex: 1; margin: 0; font-weight: 650; }
.mini { border: 0; background: transparent; color: var(--accent); padding: 0; }

.uploader {
  margin-top: 14px; min-height: 180px; border-radius: 18px; overflow: hidden;
  background: var(--card); border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 16px; position: relative;
}
.uploader input { position: absolute; inset: 0; opacity: 0; }
.uploader img { width: 100%; height: 220px; object-fit: cover; }
.logo-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.logo-row img, .logo-ph {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--card);
  border: 1px dashed var(--line);
}
.logo-ph { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; text-align: center; }

.bar { height: 8px; background: #f3eee6; border-radius: 999px; overflow: hidden; margin: 8px 0; }
.bar > span { display: block; height: 100%; background: var(--accent); }

.dock, #tab {
  position: fixed; left: 50%; transform: translateX(-50%);
  width: min(480px, 100%); bottom: 0; z-index: 5;
  background: rgba(243, 238, 230, 0.96);
  border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
.dock { display: flex; gap: 8px; }
.btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; background: var(--accent); color: #fffcf8;
  min-height: 46px; font-weight: 700; text-align: center;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.light { background: var(--card); color: var(--ink); }
.btn:disabled { opacity: 0.6; }
#tab { display: flex; }
#tab[hidden] { display: none; }
#tab a { flex: 1; text-align: center; padding: 12px 0 4px; color: var(--muted); font-size: 14px; }
#tab a.on { color: var(--accent); font-weight: 700; }

.state { padding: 48px 8px; text-align: center; color: var(--muted); }
.state h2 { color: var(--ink); font-size: 20px; margin: 0 0 8px; }
.stage { color: var(--accent); }
.live {
  margin-top: 14px; background: var(--card); border-radius: 18px; padding: 14px; white-space: pre-wrap;
}

#toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  width: min(440px, calc(100% - 32px));
  background: var(--ink); color: #fffcf8; border-radius: 14px; padding: 12px 14px;
  z-index: 9; text-align: center;
}
#modal {
  position: fixed; inset: 0; background: rgba(35, 28, 22, 0.45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 10;
}
#modal[hidden] { display: none; }
.modal-card {
  width: min(480px, 100%); background: var(--card); border-radius: 18px 18px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}
.modal-card h2 { margin: 0 0 8px; font-size: 20px; }
.modal-card p { margin: 0 0 16px; color: var(--muted); }
.modal-card button {
  width: 100%; border: 0; border-radius: 999px; background: var(--accent); color: #fffcf8;
  min-height: 46px; font-weight: 700;
}
