/* ---------------------------------------------------------------
 * SLEEPRIA 下单页样式
 * 独立文件，不与首页 styles.css 互相影响
 * ------------------------------------------------------------- */

:root {
  --ink: #202020;
  --muted: #8b8b8b;
  --line: #e6e6e6;
  --paper: #f2f2f2;
  --navy: #0a2036;
  --gold: #97793b;
  --radius: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: #fafafa;
  color: var(--ink);
  font-family: 'DM Sans', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }

button { cursor: pointer; -webkit-tap-highlight-color: transparent; }

a { color: inherit; text-decoration: none; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ---------------- 顶栏 ---------------- */

.co-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
  padding: 0 4vw;
  background: #fffffff2;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.co-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: Outfit, Arial, sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.co-brand img { height: 26px; width: auto; }

.co-back {
  font-size: 14px;
  color: var(--muted);
  transition: color .2s;
}

.co-back:hover { color: var(--ink); }

/* ---------------- 布局 ---------------- */

.co-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 4vw 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.co-main.is-narrow {
  grid-template-columns: minmax(0, 520px);
  justify-content: center;
}

/* ---------------- 商品摘要 ---------------- */

.co-summary {
  position: sticky;
  top: 100px;
}

.co-visual {
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(140deg, #f2f8fb, #e4edf2);
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
}

.co-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.co-title {
  margin: 24px 0 6px;
  font-family: Outfit, Arial, sans-serif;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.co-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
}

.co-price {
  font-family: Outfit, Arial, sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.co-bonus {
  font-size: 14px;
  color: #315b42;
  background: #eaf3ec;
  border-radius: 999px;
  padding: 4px 12px;
}

.co-meta {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

.co-meta div { display: flex; align-items: center; gap: 10px; }

.co-meta svg { flex: none; }

/* ---------------- 表单 ---------------- */

.co-form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 32px;
}

.co-form-card h1 {
  margin: 0 0 8px;
  font-family: Outfit, Arial, sans-serif;
  font-size: 24px;
  letter-spacing: -.02em;
}

.co-form-card > p {
  margin: 0 0 26px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.co-field { margin-bottom: 16px; }

.co-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #4a4a4a;
}

.co-field label .optional {
  font-weight: 400;
  color: #b0b0b0;
}

.co-field input,
.co-field select {
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
  font-size: 15px;
  color: var(--ink);
  transition: border-color .2s, background .2s;
}

.co-field input::placeholder { color: #b0b0b0; }

.co-field input:focus,
.co-field select:focus {
  outline: none;
  border-color: var(--ink);
  background: #fff;
}

.co-field .hint {
  margin-top: 6px;
  font-size: 12px;
  color: #b0b0b0;
}

.co-pay {
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .2s, transform .2s, box-shadow .2s;
}

.co-pay:hover:not([disabled]) {
  background: #3d3d3d;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px #0002;
}

.co-pay[disabled] { opacity: .55; cursor: not-allowed; }

.co-note {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: #9a9a9a;
  text-align: center;
}

.co-status {
  margin: 14px 0 0;
  min-height: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.co-status[data-kind="error"] { color: #b3261e; }

.co-status[data-kind="ok"] { color: #315b42; }

.co-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  font-size: 12px;
  color: #b0b0b0;
}

.co-divider::before,
.co-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------------- 结果页 ---------------- */

.co-result {
  max-width: 520px;
  margin: 0 auto;
  padding: 64px 4vw 100px;
  text-align: center;
}

.co-result-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eaf3ec;
  color: #315b42;
}

.co-result-icon.is-warn { background: #fdf6e7; color: #8a6d2f; }

.co-result h1 {
  margin: 0 0 14px;
  font-family: Outfit, Arial, sans-serif;
  font-size: 30px;
  letter-spacing: -.02em;
}

.co-result > p {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.6;
  color: #666;
}

.co-receipt {
  margin: 30px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  text-align: left;
  display: grid;
  gap: 12px;
}

.co-receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}

.co-receipt-row dt { color: var(--muted); margin: 0; }

.co-receipt-row dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.co-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 26px;
}

.co-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 26px;
  border-radius: 12px;
  border: 0;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  transition: background .2s, transform .2s;
}

.co-btn:hover { background: #3d3d3d; transform: translateY(-2px); }

.co-btn.ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px #20202033;
}

.co-btn.ghost:hover { background: #f2f2f2; }

/* ---------------- 提示条 ---------------- */

.co-banner {
  max-width: 1080px;
  margin: 24px auto 0;
  padding: 14px 18px;
  border-radius: 12px;
  background: #fdf6e7;
  border: 1px solid #f0e2c0;
  color: #7a6222;
  font-size: 13px;
  line-height: 1.55;
}

.co-banner[hidden] { display: none; }

.co-footer {
  padding: 30px 4vw 40px;
  text-align: center;
  font-size: 12px;
  color: #b0b0b0;
}

.co-footer a { color: #8b8b8b; text-decoration: underline; }

.co-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 37%, #f0f0f0 63%);
  background-size: 400% 100%;
  animation: co-shimmer 1.4s ease infinite;
  border-radius: 8px;
  color: transparent !important;
}

@keyframes co-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 860px) {
  .co-main {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 28px 20px 60px;
  }

  .co-summary { position: static; }

  .co-visual { aspect-ratio: 16 / 11; }

  .co-form-card { padding: 26px 20px; }

  .co-title { font-size: 22px; }

  .co-price { font-size: 26px; }

  .co-result { padding: 40px 20px 70px; }

  .co-result h1 { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .co-pay:hover:not([disabled]),
  .co-btn:hover { transform: none; }
}
