:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f6f5f3;
  --hairline: #ecebe8;
  --hairline-strong: #dcdad5;
  --ink: #16161a;
  --ink-2: #3a3a40;
  --muted: #8a8a90;
  --light: #a8a8ad;
  --placeholder: #c4c4c9;
  --accent: #e0a019;
  --accent-hover: #c98c10;
  --accent-soft: rgba(224, 160, 25, 0.10);
  --accent-deep: #a9760a;
  --accent-grad: linear-gradient(135deg, #f0ad2e 0%, #d98e14 100%);
  --gold-glow: 0 6px 18px -6px rgba(208, 142, 20, 0.55);
  --danger: #e5484d;
  --success: #1f9d57;
  --shadow-card: 0 1px 2px rgba(20, 18, 12, 0.04), 0 10px 30px -16px rgba(20, 18, 12, 0.16);
  --shadow-md: 0 8px 30px -8px rgba(20, 18, 12, 0.18);
  --shadow-accent: 0 6px 18px -6px rgba(208, 142, 20, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(224, 160, 25, 0.07) 0%, rgba(224, 160, 25, 0) 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.mono {
  font-family: "SF Mono", "Fira Code", Consolas, "Courier New", monospace;
}

.shell {
  width: min(760px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.shell-narrow {
  width: min(440px, calc(100vw - 32px));
}

/* 登录页：垂直居中，更聚焦 */
body.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

body.auth-body .shell {
  padding: 0;
}

.auth-foot {
  color: var(--light);
  font-size: 13px;
  margin-top: 22px;
  text-align: center;
}

.shell-wide {
  width: min(1120px, calc(100vw - 40px));
}

.brand {
  text-align: center;
  margin-bottom: 30px;
}

.brand h1 {
  color: var(--ink);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.brand p {
  color: var(--muted);
  font-size: 15px;
  max-width: 30em;
  margin: 0 auto;
}

/* 品牌徽标：渐变金圆形 + 图标 */
.brand-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 20px;
  background: var(--accent-grad);
  box-shadow: var(--gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  line-height: 1;
}

.brand-mark.round {
  border-radius: 50%;
}

.top-chrome {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.top-brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.top-mark {
  align-items: center;
  background: var(--accent-grad);
  border-radius: 13px;
  box-shadow: var(--gold-glow);
  display: inline-flex;
  flex-shrink: 0;
  font-size: 22px;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.top-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.top-sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

.top-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.user-chip {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--ink-2);
  display: inline-flex;
  font-size: 14px;
  font-weight: 650;
  min-height: 42px;
  padding: 0 14px;
  align-items: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 30px;
}

.card + .card {
  margin-top: 18px;
}

.auth-card {
  padding: 32px 30px;
}

.label {
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.upload-zone {
  align-items: center;
  background: linear-gradient(180deg, #fffdf9, #fff7ea);
  border: 1.5px dashed var(--hairline-strong);
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 210px;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.upload-zone:hover,
.upload-zone.dragging {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--gold-glow);
}

.upload-icon {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 8px;
}

.upload-title {
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
}

.upload-hint {
  color: var(--muted);
  font-size: 13px;
}

.file-pill {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  color: var(--ink-2);
  display: none;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
}

.file-pill.visible {
  display: flex;
}

.file-pill strong {
  color: var(--ink);
  flex: 1;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-pill span {
  color: var(--muted);
  font-size: 12px;
}

.form-row {
  align-items: center;
  border-top: 1px solid var(--hairline);
  display: flex;
  gap: 16px;
  margin-top: 22px;
  padding-top: 22px;
}

.form-row label {
  color: var(--ink-2);
  flex: 1;
  font-size: 15px;
  font-weight: 650;
}

.form-row input {
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  color: var(--ink);
  outline: none;
  padding: 10px 12px;
  width: 108px;
}

.form-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.primary-btn,
.secondary-btn {
  align-items: center;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  font-size: 16px;
  font-weight: 700;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.inline-btn {
  min-height: 42px;
  padding: 0 16px;
  text-decoration: none;
}

.primary-btn {
  background: var(--accent-grad);
  box-shadow: var(--shadow-accent);
  color: #fff;
  letter-spacing: 0.02em;
  width: 100%;
}

.primary-btn:hover {
  box-shadow: 0 8px 22px -6px rgba(208, 142, 20, 0.6);
  transform: translateY(-1px);
}

.primary-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-accent);
}

.primary-btn:disabled {
  background: var(--hairline-strong);
  box-shadow: none;
  color: #fff;
  cursor: not-allowed;
  transform: none;
}

.secondary-btn {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  color: var(--ink);
}

.secondary-btn:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

/* 幽灵按钮：登录页发码用，轻量不抢戏 */
.ghost-btn {
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--accent-deep);
  cursor: pointer;
  font-size: 15px;
  font-weight: 650;
  min-height: 50px;
  padding: 0 16px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.ghost-btn:hover {
  background: rgba(224, 160, 25, 0.16);
}

.ghost-btn:disabled {
  background: var(--surface-2);
  color: var(--light);
  cursor: not-allowed;
}

.actions {
  margin-top: 20px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.field span {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 650;
}

.field input,
.table-input {
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--ink);
  outline: none;
  padding: 14px 16px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.field input::placeholder {
  color: var(--placeholder);
}

.field input:focus,
.table-input:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.code-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

.code-btn {
  min-height: 48px;
}

.hint {
  color: var(--success);
  display: none;
  font-size: 14px;
}

.hint.visible {
  display: block;
}

.notice {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 16px;
  padding: 12px 16px;
}

.toolbar-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented-btn {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--ink-2);
  cursor: pointer;
  min-height: 40px;
  padding: 0 14px;
}

.segmented-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-deep);
}

.table-wrap {
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  border-top: 1px solid var(--hairline);
  padding: 14px 10px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.checkbox-cell {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.mini-btn {
  min-height: 36px;
  padding: 0 14px;
}

.error {
  color: var(--danger);
  display: none;
  font-size: 14px;
  margin-top: 12px;
  text-align: center;
}

.error.visible {
  display: block;
}

.progress-card {
  display: none;
}

.progress-card.visible {
  display: block;
}

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

.progress-title {
  font-size: 18px;
  font-weight: 750;
}

.progress-elapsed {
  color: var(--muted);
  font-size: 13px;
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step {
  align-items: center;
  border-bottom: 1px solid var(--hairline);
  display: grid;
  gap: 14px;
  grid-template-columns: 28px 1fr auto;
  min-height: 58px;
  padding: 10px 0;
}

.step:last-child {
  border-bottom: 0;
}

.step-dot {
  align-items: center;
  background: var(--surface-2);
  border-radius: 50%;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 750;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.step.done .step-dot {
  background: var(--accent);
  color: #fff;
}

.step.active .step-dot {
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  color: var(--accent-deep);
}

.step-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.step-detail {
  color: var(--muted);
  font-size: 13px;
  margin-top: 1px;
}

.step-time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.bar {
  background: var(--surface-2);
  border-radius: 999px;
  height: 8px;
  margin-top: 18px;
  overflow: hidden;
}

.bar-fill {
  background: var(--accent);
  height: 100%;
  transition: width 0.2s ease;
  width: 0;
}

.spinner {
  animation: spin 0.7s linear infinite;
  border: 2px solid rgba(245, 166, 35, 0.25);
  border-radius: 50%;
  border-top-color: var(--accent);
  display: inline-block;
  height: 15px;
  width: 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal {
  align-items: center;
  background: rgba(250, 250, 250, 0.82);
  backdrop-filter: blur(12px);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 1000;
}

.modal.visible {
  display: flex;
}

.modal-panel {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 26px;
  width: min(720px, calc(100vw - 48px));
}

.modal-title {
  font-size: 22px;
  font-weight: 780;
  line-height: 1.3;
  margin-bottom: 6px;
}

.modal-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.speaker-group {
  border-top: 1px solid var(--hairline);
  padding: 18px 0;
}

.speaker-head {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.speaker-head label {
  color: var(--ink-2);
  font-weight: 700;
  min-width: 88px;
}

.speaker-head input {
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  flex: 1;
  outline: none;
  padding: 10px 12px;
}

.speaker-examples {
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  font-size: 14px;
  gap: 6px;
  line-height: 1.55;
  padding-left: 100px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 18px;
}

@media (max-width: 640px) {
  .shell {
    width: calc(100vw - 28px);
    padding-top: 36px;
  }

  .brand h1 {
    font-size: 30px;
  }

  .card {
    padding: 22px;
  }

  .top-chrome,
  .toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .form-row,
  .speaker-head {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .form-row input {
    width: 100%;
  }

  .code-row {
    grid-template-columns: 1fr;
  }

  .speaker-examples {
    padding-left: 0;
  }
}

/* ============ AI 剪辑分析面板 ============ */
.analysis-card {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.analysis-card.visible {
  display: block;
}

.analysis-card.entered {
  opacity: 1;
  transform: translateY(0);
}

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

.analysis-head .label {
  margin-bottom: 0;
}

.analysis-status {
  color: var(--muted);
  font-size: 13px;
}

.analysis-status.done {
  color: var(--success);
}

.analysis-body {
  min-height: 80px;
}

/* streaming cursor */
.analysis-body.streaming::after {
  animation: blink 1s step-start infinite;
  background: var(--accent);
  border-radius: 1px;
  content: '';
  display: inline-block;
  height: 1em;
  margin-left: 3px;
  opacity: 0.7;
  vertical-align: text-bottom;
  width: 2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* markdown 渲染 */
.markdown-body h2 {
  border-bottom: 1px solid var(--hairline);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.01em;
  margin: 28px 0 14px;
  padding-bottom: 8px;
}

.markdown-body h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 20px 0 10px;
}

.markdown-body p {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.85;
  margin: 10px 0;
}

.markdown-body ul,
.markdown-body ol {
  margin: 10px 0;
  padding-left: 22px;
}

.markdown-body li {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.8;
  margin: 6px 0;
}

.markdown-body strong {
  color: var(--ink);
  font-weight: 700;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 24px 0;
}

.analysis-foot {
  border-top: 1px solid var(--hairline);
  display: none;
  margin-top: 28px;
  padding-top: 20px;
}

.analysis-foot.visible {
  display: block;
}

.analysis-review-btn {
  font-size: 16px;
  letter-spacing: 0.02em;
  text-decoration: none;
}

/* ============ 欢迎页 welcome.html ============ */
.welcome-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 0;
  background:
    linear-gradient(90deg, rgba(248, 250, 255, 0.96) 0%, rgba(248, 250, 255, 0.88) 32%, rgba(248, 250, 255, 0.22) 62%, rgba(248, 250, 255, 0) 100%),
    url("../assets/hero.png") right center / auto 100% no-repeat,
    linear-gradient(135deg, #f7f1e6 0%, #fbf7ef 45%, #f4ece0 100%);
  overflow-x: hidden;
}

.welcome-frame {
  width: 100%;
  min-height: 100vh;
}

.welcome-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.48fr) 1fr;
  align-items: center;
  min-height: 100vh;
  max-width: 1320px;
  margin: 0 auto;
  padding: 58px clamp(54px, 8vw, 112px);
}

.welcome-left {
  padding: 0;
}

.welcome-logo {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 52px;
}

.welcome-logo-mark {
  width: 52px;
  height: 57px;
  object-fit: contain;
}

.welcome-logo-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.welcome-logo-sub {
  color: var(--accent-deep);
  font-size: 13px;
  letter-spacing: 0.34em;
  margin-top: 2px;
}

.welcome-title {
  font-size: clamp(38px, 4.6vw, 58px);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.16;
}

.welcome-title span {
  display: block;
}

.welcome-title .grad {
  background: linear-gradient(100deg, #e7b54e 0%, #c98a1f 55%, #b9791a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-lead {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.85;
  margin-top: 22px;
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 34px 0;
}

.feat {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  box-shadow: 0 6px 18px -12px rgba(150, 110, 40, 0.4);
  padding: 16px 10px;
  text-align: center;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.feat-ic {
  color: var(--accent-deep);
  display: inline-flex;
  margin-bottom: 8px;
}

.feat b {
  color: var(--ink);
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.feat i {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-style: normal;
  margin-top: 3px;
}

.welcome-cta {
  align-items: center;
  background: var(--accent-grad);
  border-radius: 999px;
  box-shadow: 0 14px 30px -10px rgba(201, 138, 31, 0.6);
  color: #fff;
  display: inline-flex;
  font-size: 18px;
  font-weight: 750;
  gap: 10px;
  justify-content: center;
  letter-spacing: 0.04em;
  min-height: 62px;
  padding: 0 44px;
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.welcome-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -10px rgba(201, 138, 31, 0.7);
}

.welcome-login {
  color: var(--muted);
  font-size: 15px;
  margin-top: 22px;
}

.welcome-login a {
  color: var(--accent-deep);
  font-weight: 650;
  margin-left: 4px;
  text-decoration: none;
}

.welcome-login a:hover {
  text-decoration: underline;
}

.welcome-art {
  display: none;
}

.welcome-art img {
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: contain;
}

@media (max-width: 860px) {
  .welcome-body {
    background:
      linear-gradient(180deg, rgba(248, 250, 255, 0.16) 0%, rgba(248, 250, 255, 0.7) 28%, rgba(248, 250, 255, 0.98) 46%, rgba(251, 247, 239, 1) 100%),
      url("../assets/hero.png") center top / auto 330px no-repeat,
      linear-gradient(135deg, #f7f1e6 0%, #fbf7ef 45%, #f4ece0 100%);
  }
  .welcome-frame {
    border-radius: 0;
    min-height: 100vh;
    width: 100%;
  }
  .welcome-grid {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: 100vh;
    padding: 246px 22px 30px;
  }
  .welcome-left { padding: 0; }
  .welcome-logo { margin-bottom: 16px; }
  .welcome-title { font-size: clamp(30px, 8.4vw, 40px); line-height: 1.14; letter-spacing: 0; }
  .welcome-lead { font-size: 14.5px; line-height: 1.68; margin-top: 14px; }
  .welcome-features {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 18px 0;
  }
  .feat { padding: 13px 8px; }
  .welcome-cta { width: 100%; min-height: 54px; font-size: 17px; }
  .welcome-login { margin-top: 16px; }
}
