/* ==========================================================================
   style.css —— 商户端全局样式（T4.2）
   现代商务 · 玻璃拟态 · 蓝色主色（用户指定 rgb 98,172,225 / 182,221,246）· 引导式向导
   ⚠️ 手写 CSS（不引 Tailwind CDN）：第三方 CDN 是供应链风险（生产待办清单工程化项）。
   ========================================================================== */

:root {
  --primary: #62ace1;          /* rgb(98,172,225) 主色 */
  --primary-light: #7fb9e7;
  --primary-dark: #4a96cf;
  --primary-pale: #b6ddf6;     /* rgb(182,221,246) 浅色 */
  --bg: #f4f9fd;
  --bg-accent: #e6f3fb;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --text-invert: #ffffff;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --border: rgba(15, 23, 42, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(98, 172, 225, 0.12);
  --shadow-lg: 0 24px 60px rgba(98, 172, 225, 0.2);
  --font: "PingFang SC", "Noto Sans Thai", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Helvetica Neue", sans-serif;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(98, 172, 225, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(182, 221, 246, 0.35), transparent 55%),
    linear-gradient(160deg, #e6f3fb 0%, #f4f9fd 45%, #ffffff 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* 布局容器 */
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 品牌区 */
.brand {
  text-align: center;
}

.brand-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-invert);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  box-shadow: 0 8px 20px rgba(98, 172, 225, 0.35);
}

.brand-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 14px;
  color: var(--text-muted);
}

/* 玻璃拟态卡片 */
.card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
}

.card-title {
  font-size: 22px;
  font-weight: 700;
}

.card-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 4px 0 20px;
}

/* 表单 */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(98, 172, 225, 0.14);
}

/* 按钮 */
.btn {
  min-height: 46px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  color: var(--text-invert);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  box-shadow: 0 8px 20px rgba(98, 172, 225, 0.3);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 12px 26px rgba(98, 172, 225, 0.4);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: #fff;
  box-shadow: var(--shadow);
}

/* 提示 / 错误 */
.hint {
  font-size: 13px;
  color: var(--text-muted);
}

.error {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--danger);
}

.loading {
  color: var(--text-muted);
  text-align: center;
  padding: 24px 0;
}

/* 页头（向导） */
.wizard-header .brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.wizard-header .brand-logo {
  width: 44px;
  height: 44px;
  margin: 0;
  font-size: 22px;
  border-radius: 14px;
}

.wizard-header .brand-name {
  font-size: 18px;
}

.wizard-header .brand-sub {
  font-size: 12px;
}

.wizard-title {
  font-size: 24px;
  font-weight: 700;
}

.wizard-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 步骤指示器 */
.steps {
  list-style: none;
  display: flex;
  gap: 0;
  padding: 0 4px;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  font-size: 12px;
  color: var(--text-muted);
}

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 15px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: rgba(15, 23, 42, 0.1);
  transition: background 0.3s;
}

.step.done:not(:last-child)::after,
.step.active:not(:last-child)::after {
  background: var(--primary-light);
}

.step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-muted);
  transition: all 0.3s;
}

.step.active .step-dot {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  box-shadow: 0 6px 14px rgba(98, 172, 225, 0.4);
}

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

.step.active .step-label {
  color: var(--primary-dark);
  font-weight: 600;
}

/* ⚠️ [hidden] 兜底：HTML hidden 属性的默认 display:none 会被 .panel/.section 等
   display:flex 类规则覆盖，导致带 hidden 的步骤面板全部平铺显示（T4.2 生产事故）。
   这里用 !important 强制：凡带 hidden 属性的元素一律不显示。 */
[hidden] {
  display: none !important;
}

/* 面板 */
.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-title {
  font-size: 18px;
  font-weight: 700;
}

.panel-actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 4px;
}

.panel-actions .btn {
  flex: 1;
}

.panel-actions .btn:only-child {
  flex: none;
  width: 100%;
}

/* 协议 iframe */
.agreement-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}

.agreement-frame {
  width: 100%;
  height: 420px;
  border: none;
  display: block;
}

/* 同意复选框行 */
.agree-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.agree-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* 开关 */
.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.switch-row input {
  display: none;
}

.switch-ui {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.15);
  position: relative;
  transition: background 0.25s;
  flex-shrink: 0;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s;
}

.switch-row input:checked + .switch-ui {
  background: var(--primary);
}

.switch-row input:checked + .switch-ui::after {
  transform: translateX(20px);
}

/* 上传 */
.upload-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-status {
  font-size: 13px;
  color: var(--success);
}

/* 签名板 */
.signature-wrap {
  border: 1px dashed rgba(98, 172, 225, 0.4);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}

.signature-canvas {
  width: 100%;
  height: 200px;
  display: block;
  touch-action: none; /* 防移动端触摸时页面滚动/缩放 */
  cursor: crosshair;
}

/* 汇总 */
.summary {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(182, 221, 246, 0.28);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.summary li {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.summary-key {
  color: var(--text-muted);
}

.summary-val {
  font-weight: 600;
}

/* 完成标记 */
.done-mark {
  width: 64px;
  height: 64px;
  margin: 8px auto 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
  box-shadow: 0 12px 26px rgba(16, 185, 129, 0.4);
  animation: pop 0.4s ease;
}

@keyframes pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 响应式 */
@media (max-width: 480px) {
  .page {
    padding: 24px 14px 48px;
  }

  .card {
    padding: 24px 18px;
  }

  .agreement-frame {
    height: 360px;
  }
}
