* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6f8;
  color: #1f2937;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}
.topbar {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  padding: 18px 16px 14px;
  text-align: center;
}
.brand { font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.tagline { font-size: 13px; opacity: .8; margin-top: 2px; }

.stepper {
  display: flex; justify-content: space-between;
  background: #fff; padding: 10px 8px; border-bottom: 1px solid #e5e7eb;
  position: sticky; top: 0; z-index: 5;
}
.step { font-size: 12px; color: #9ca3af; display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.step i {
  width: 22px; height: 22px; border-radius: 50%; background: #e5e7eb; color: #6b7280;
  display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700; font-size: 12px;
}
.step.active { color: #111827; }
.step.active i { background: #0f172a; color: #fff; }

main { padding: 12px; }
.card {
  background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.card h2 { font-size: 16px; margin: 0 0 4px; }
.hint { font-size: 12px; color: #6b7280; margin: 0 0 12px; }
.muted { font-size: 12px; color: #9ca3af; }

.upload-row { display: flex; gap: 10px; }
.big-btn {
  flex: 1; border: 1px solid #d1d5db; background: #fff; color: #111827;
  border-radius: 12px; padding: 16px 10px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform .05s;
}
.big-btn:active { transform: scale(.98); }
.big-btn.primary { background: #0f172a; color: #fff; border-color: #0f172a; }
.big-btn.block { width: 100%; margin-top: 8px; }
.big-btn:disabled { opacity: .45; cursor: not-allowed; }
/* 快手主色：橙红，用于选中态与发布按钮（区别于抖音的深色） */
.big-btn.kuaishou { background: #ff4906; border-color: #ff4906; color: #fff; }

/* 发布平台切换 Tab */
.platform-tabs { display: flex; gap: 10px; margin-bottom: 14px; }
.ptab {
  flex: 1; border: 2px solid #e5e7eb; background: #fff; border-radius: 12px;
  padding: 12px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: border-color .15s, background .15s;
}
.ptab:active { transform: scale(.98); }
.ptab.active { border-color: #0f172a; background: #f8fafc; }
.ptab[data-platform="kuaishou"].active { border-color: #ff4906; background: #fff7f3; }
.ptab .picon { font-size: 20px; line-height: 1; }
.ptab .pname { font-size: 15px; font-weight: 700; color: #111827; }
.ptab .pstate { font-size: 10px; color: #9ca3af; margin-top: 2px; text-align: center; white-space: nowrap; }
.ptab .pstate.ready { color: #16a34a; }

.clip-list { list-style: none; padding: 0; margin: 12px 0 0; }
.clip-list li {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: #f3f4f6; border-radius: 10px; margin-bottom: 8px; font-size: 13px;
}
.clip-list .tag { font-size: 11px; color: #fff; background: #0f172a; border-radius: 6px; padding: 2px 6px; }
.clip-list .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-list .del { color: #ef4444; font-weight: 700; cursor: pointer; padding: 4px 8px; }

.tpl-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.tpl {
  flex: 0 0 140px; border: 2px solid #e5e7eb; border-radius: 12px; padding: 10px;
  cursor: pointer; background: #fff;
}
.tpl.selected { border-color: #0f172a; background: #f8fafc; }
.tpl .tname { font-weight: 700; font-size: 14px; }
.tpl .tdesc { font-size: 11px; color: #6b7280; margin-top: 4px; }
.tpl .swatch { height: 8px; border-radius: 4px; margin-top: 8px; }

.field { display: block; margin-bottom: 12px; }
.field span { font-size: 13px; color: #374151; display: block; margin-bottom: 6px; }
.field textarea, .field input {
  width: 100%; border: 1px solid #d1d5db; border-radius: 10px; padding: 10px;
  font-size: 15px; font-family: inherit; resize: none;
}

.progress { margin-top: 12px; }
.progress .bar { height: 6px; background: #0f172a; border-radius: 4px; width: 0; transition: width .3s; }
.progress span { font-size: 12px; color: #6b7280; display: block; margin-top: 6px; }

.preview { margin-top: 12px; }
.preview video { width: 100%; border-radius: 12px; background: #000; }

.foot { text-align: center; font-size: 11px; color: #9ca3af; padding: 16px 0 24px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 20px; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 16px; padding: 20px; width: 100%; max-width: 360px; }
.modal-box h3 { margin: 0 0 10px; font-size: 17px; }
.modal-box p { font-size: 14px; color: #374151; margin: 0 0 14px; white-space: pre-line; }
.modal-box a.big-btn { display: block; text-align: center; text-decoration: none; margin-bottom: 8px; }
