*, *::before, *::after { box-sizing: border-box; }

/* 关键：hidden 必须优先于 display:grid/flex，否则遮罩层会拦截点击 */
[hidden] { display: none !important; }

:root {
  --bg: #0A0C11;
  --panel: #12151D;
  --panel-2: #171B25;
  --line: #232838;
  --ink: #F2F4F8;
  --muted: #878FA3;
  --brand: #FF6B2C;
  --brand-2: #FF9558;
  --ok: #34D399;
  --err: #F87171;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100dvh; }

.glow {
  position: fixed;
  inset: -20% -20% auto -20%;
  height: 420px;
  background: radial-gradient(circle at 30% 20%, rgba(255,107,44,.28), transparent 62%),
              radial-gradient(circle at 85% 0%, rgba(90,120,255,.16), transparent 55%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px 150px;
}

/* ---------------- topbar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .4px;
  color: #C9CFDD;
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(255,107,44,.16);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255,107,44,.16); }
  50% { box-shadow: 0 0 0 7px rgba(255,107,44,.05); }
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: inherit;
}

/* ---------------- hero ---------------- */
.hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 26px;
}

.avatar {
  width: 52px; height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--brand), #FF4D6D);
  box-shadow: 0 8px 24px rgba(255,107,44,.32);
  flex: 0 0 auto;
}

.hero-text h1 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.hero-text p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------------- form ---------------- */
form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 8px; }

.field > label {
  font-size: 12.5px;
  font-weight: 600;
  color: #B7BFCF;
  letter-spacing: .2px;
}

.field > label b { color: var(--brand); font-weight: 700; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input[type="text"], input[type="url"], input[type="datetime-local"], input[type="password"], input:not([type]), textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px 15px;
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .18s, background .18s;
  -webkit-appearance: none;
}

input::placeholder, textarea::placeholder { color: #5C6478; }

input:focus, textarea:focus {
  border-color: rgba(255,107,44,.65);
  background: #171A24;
  box-shadow: 0 0 0 3px rgba(255,107,44,.12);
}

/* 分享文案通常是一整段（含标题和口令尾巴），用多行框完整展示；
   粘贴按钮固定在右上角，不随文本高度居中遮挡内容。 */
.url-wrap textarea {
  min-height: 96px;
  line-height: 1.65;
  resize: vertical;
  padding-right: 68px;
  font-size: 14px;
}
.url-wrap .paste-btn { top: 12px; transform: none; }

input[type="datetime-local"] { color-scheme: dark; }

.tip { margin: 0; font-size: 11.5px; color: #666E82; }
.tip.err { color: var(--err); display: none; }
.tip.err.show { display: block; }

/* ---------------- chips ---------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  border: 1px solid var(--line);
  background: var(--panel);
  color: #A9B2C4;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 999px;
  font-family: inherit;
  transition: all .16s;
  white-space: nowrap;
}

.chip:active { transform: scale(.96); }

.chip.on {
  background: rgba(255,107,44,.14);
  border-color: rgba(255,107,44,.6);
  color: #FFB08A;
  font-weight: 600;
}

/* ---------------- 上播 / 下播 分段选择 ---------------- */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.seg-item {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 0;
  border-radius: 10px;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.seg-item.on {
  background: linear-gradient(140deg, var(--brand), #FF4D6D);
  color: #fff;
  box-shadow: 0 6px 18px rgba(255,107,44,.3);
}

.seg-item:active { transform: scale(.985); }

/* 多选一：开播准备 / 上播 / 下播 / 其他（按主播配置可只显示部分） */
.seg.seg2 { grid-template-columns: repeat(2, 1fr); }
.seg.seg3 { grid-template-columns: repeat(3, 1fr); }
.seg.seg4 { grid-template-columns: repeat(4, 1fr); }
.seg3 .seg-item, .seg2 .seg-item { padding: 12px 4px; font-size: 14px; }
.seg4 .seg-item { padding: 12px 2px; font-size: 13px; }

/* 补充信息分隔条 */
.divider {
  display: flex; align-items: center; gap: 10px;
  margin: 22px 0 14px;
  color: var(--muted); font-size: 12px;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.divider span { white-space: nowrap; letter-spacing: .5px; }

/* 两列并排 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 多图 / 多文件 */
.multi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.thumb {
  position: relative; aspect-ratio: 1 / 1;
  border-radius: 12px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .fname {
  font-size: 11px; color: var(--muted); padding: 8px;
  text-align: center; word-break: break-all; line-height: 1.4;
}
.thumb .rm {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(10,12,17,.78); color: #fff;
  font-size: 15px; line-height: 1; cursor: pointer;
}

.add-file {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 13px;
  background: transparent; border: 1px dashed var(--line);
  border-radius: 12px; color: var(--muted);
  font-size: 13px; cursor: pointer;
}
.add-file:active { border-color: rgba(255,107,44,.5); color: var(--brand-2); }

.field-hint { margin: 0; font-size: 11px; color: #5C6478; }

/* 需要主播照做的说明（如文件命名规范），比普通提示更显眼一点 */
.field-note {
  margin: 2px 0 0; padding: 8px 10px;
  border-left: 2px solid rgba(255,107,44,.6);
  background: rgba(255,107,44,.07);
  border-radius: 0 8px 8px 0;
  font-size: 11px; line-height: 1.7; color: #C9CFDD;
}
.field-note b { color: var(--brand-2); font-weight: 600; }

/* ---------------- 演示预览提示条 ---------------- */
.demo-bar {
  display: flex; gap: 8px; align-items: flex-start;
  margin: 0 0 14px; padding: 10px 12px;
  background: rgba(255,107,44,.12);
  border: 1px solid rgba(255,107,44,.35);
  border-radius: 12px;
  font-size: 12px; line-height: 1.6; color: #FFD9C7;
}
.demo-bar b { flex: none; color: var(--brand-2); font-weight: 600; }

/* ---------------- url ---------------- */
.url-wrap { position: relative; }

.url-wrap input { padding-right: 68px; font-size: 14px; }

.paste-btn {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  background: #262B39;
  border: none;
  color: #C9CFDD;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 9px;
  font-family: inherit;
}

/* ---------------- upload ---------------- */
.upload {
  position: relative;
  display: block;
  border: 1.5px dashed #2E3447;
  border-radius: 15px;
  background: rgba(18,21,29,.6);
  transition: border-color .18s, background .18s;
  overflow: hidden;
  min-height: 116px;
}

.upload:active { border-color: rgba(255,107,44,.5); }

.upload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 16px;
  color: #5C6478;
}

.upload-empty span { font-size: 13px; color: #9AA3B7; }

.upload-empty em { font-style: normal; font-size: 11px; color: #5C6478; }

.upload-preview { position: relative; }

.upload-preview img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.upload-preview button {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  backdrop-filter: blur(6px);
}

/* 游戏由运营设定：主播端只读确认 */
.game-confirm {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.game-confirm .game-name { font-size: 17px; font-weight: 700; color: var(--ink); }
.game-confirm .game-tag {
  margin-left: auto; font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px;
}

/* ---------------- submit bar ---------------- */
/* 提交按钮跟随表单内容居中，不再做底部通栏悬浮 */
.submitbar { margin: 4px 0 12px; padding: 0; }

.submitbar > * { max-width: 520px; margin-left: auto; margin-right: auto; }

.primary {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  font-family: inherit;
  background: linear-gradient(135deg, #FF7A3D, #FF4D2D);
  box-shadow: 0 10px 26px rgba(255,77,45,.3);
  transition: transform .12s, opacity .2s;
}

.primary:active { transform: scale(.985); }

.primary:disabled { opacity: .55; box-shadow: none; }

.foot {
  text-align: center;
  font-size: 11px;
  color: #596074;
  margin: 10px 0 0;
}

/* ---------------- success sheet ---------------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(6,8,12,.82);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.sheet[hidden] { display: none; }

.sheet-card {
  width: 100%;
  max-width: 360px;
  background: #14171F;
  border: 1px solid #262B39;
  border-radius: 24px;
  padding: 32px 24px 24px;
  text-align: center;
  animation: pop .32s cubic-bezier(.2,.9,.3,1.2);
}

@keyframes pop {
  from { transform: scale(.92) translateY(10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.check { width: 64px; height: 64px; margin: 0 auto 16px; }
.check svg { width: 100%; height: 100%; }
.check circle {
  fill: none; stroke: rgba(52,211,153,.28); stroke-width: 2;
  stroke-dasharray: 151; stroke-dashoffset: 151;
  animation: draw .55s ease forwards;
}
.check path {
  fill: none; stroke: var(--ok); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 42; stroke-dashoffset: 42;
  animation: draw .4s .3s ease forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }

.sheet-card h2 { margin: 0 0 8px; font-size: 19px; }

.sheet-card > p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.6; }

.stat-line {
  margin: 18px 0 20px;
  padding: 12px;
  border-radius: 12px;
  background: #1B1F2A;
  font-size: 13px;
  color: #C9CFDD;
}

.stat-line b { color: var(--brand-2); }

/* 发送失败时给提报人看的明确提示 */
.fail-box {
  margin: -8px 0 18px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,107,44,.35);
  background: rgba(255,107,44,.08);
}
.fail-box[hidden] { display: none; }
.fail-reason {
  font-size: 12.5px;
  color: #FFB694;
  line-height: 1.6;
  word-break: break-word;
  margin-bottom: 10px;
}
.fail-tip { margin: 8px 0 0 !important; font-size: 11px !important; color: #7E879C !important; }
.check.failed circle { stroke: rgba(255,107,44,.3); }
.check.failed path { stroke: #FF8A5B; }

.sheet-foot { margin-top: 14px !important; font-size: 11px !important; color: #5C6478 !important; }

/* ---------------- toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translate(-50%, 20px);
  background: #2A1A16;
  border: 1px solid rgba(255,107,44,.4);
  color: #FFC4A8;
  font-size: 13px;
  padding: 11px 18px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: all .22s;
  z-index: 60;
  max-width: calc(100vw - 48px);
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 600px) {
  .page { padding-top: 8px; }
  .hero { margin-top: 34px; }
}

/* ICP / 公安备案号 */
.icp-bar {
  text-align: center;
  padding: 18px 12px 24px;
  font-size: 12px;
  color: #6B7486;
  line-height: 1.9;
}
.icp-bar a { color: #7E879B; text-decoration: none; }
.icp-bar a:hover { color: #A8B0C0; text-decoration: underline; }
.icp-ga { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; }
.icp-ga[hidden] { display: none; }
.icp-ga img { width: 16px; height: 16px; vertical-align: middle; }
