/* ==========================================================
   私人定制工作室 · 下单页面样式
   多主题随机（warm / ocean / forest / violet / night）
   ========================================================== */

/* ---------- 主题变量 ---------- */
:root,
body[data-theme="warm"] {
    --bg: linear-gradient(160deg, #faf3ea 0%, #f3e3d2 100%);
    --card: #fffdf9;
    --accent: #b4532a;
    --accent-soft: #f0dccb;
    --accent-dark: #8f3d1c;
    --text: #3a2b23;
    --muted: #9a8578;
    --border: #eadfd4;
    --ok: #2f8f5b;
    --err: #c0392b;
    --shadow: 0 18px 50px rgba(120, 82, 50, 0.14);
}

body[data-theme="ocean"] {
    --bg: linear-gradient(160deg, #eaf4f7 0%, #d3e7ee 100%);
    --card: #fbfefe;
    --accent: #1f6f8b;
    --accent-soft: #d5e9f0;
    --accent-dark: #134f64;
    --text: #22343c;
    --muted: #7f98a3;
    --border: #d9e6ec;
    --ok: #1f8f7a;
    --err: #c0392b;
    --shadow: 0 18px 50px rgba(31, 111, 139, 0.15);
}

body[data-theme="forest"] {
    --bg: linear-gradient(160deg, #eef4ea 0%, #d9e8d0 100%);
    --card: #fcfffa;
    --accent: #3f7d3a;
    --accent-soft: #dcedd6;
    --accent-dark: #2a5c27;
    --text: #2b3a28;
    --muted: #8ba183;
    --border: #dbe8d5;
    --ok: #2f8f5b;
    --err: #c0392b;
    --shadow: 0 18px 50px rgba(63, 125, 58, 0.15);
}

body[data-theme="violet"] {
    --bg: linear-gradient(160deg, #f2edfb 0%, #e2d9f5 100%);
    --card: #fdfcff;
    --accent: #6d4aa8;
    --accent-soft: #e4d9f5;
    --accent-dark: #4e327e;
    --text: #332a44;
    --muted: #9487ad;
    --border: #e4dced;
    --ok: #2f8f5b;
    --err: #c0392b;
    --shadow: 0 18px 50px rgba(109, 74, 168, 0.16);
}

body[data-theme="night"] {
    --bg: linear-gradient(160deg, #232a3a 0%, #141a26 100%);
    --card: #2a3245;
    --accent: #7fb0ff;
    --accent-soft: #33405c;
    --accent-dark: #5c8ae0;
    --text: #e8ecf5;
    --muted: #8f9bb5;
    --border: #3a4560;
    --ok: #57c08a;
    --err: #ff6b6b;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}

/* ---------- 基础重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    background-attachment: fixed;
    min-height: 100vh;
    transition: background 0.6s ease;
}

.page {
    max-width: 720px;
    margin: 0 auto;
    padding: 28px 18px 48px;
}

/* ---------- 品牌区 ---------- */
.brand {
    text-align: center;
    margin-bottom: 22px;
}

.brand-logo {
    width: 62px;
    height: 62px;
    margin: 0 auto 10px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.brand h1 {
    font-size: 26px;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.brand p {
    color: var(--muted);
    font-size: 13px;
}

.page-stamp {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 12px;
    border: 1px dashed var(--accent);
    border-radius: 999px;
    color: var(--accent);
    font-size: 12px;
    letter-spacing: 1px;
}

/* ---------- 下单卡片 ---------- */
.order-card {
    background: var(--card);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 26px 26px 22px;
    border: 1px solid var(--border);
}

.progress {
    height: 6px;
    background: var(--accent-soft);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 14px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
    border-radius: 999px;
    transition: width 0.5s ease;
}

.step-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 6px;
}

.step-indicator {
    font-weight: 700;
    font-size: 15px;
    color: var(--accent-dark);
}

.random-hint {
    font-size: 12px;
    color: var(--muted);
}

/* ---------- 步骤通用 ---------- */
.step-head {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
}

.step-badge {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-head h2 {
    font-size: 18px;
    letter-spacing: 1px;
}

.step-head p {
    font-size: 13px;
    color: var(--muted);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.form-group label .req {
    color: var(--err);
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--text);
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
    font-family: inherit;
}

textarea {
    resize: vertical;
    min-height: 88px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- 商品选择卡片 ---------- */
.option-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.option-card {
    position: relative;
    display: block;
    padding: 14px;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    background: var(--card);
}

.option-card:hover {
    transform: translateY(-2px);
}

.option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-card:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.option-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.option-price {
    color: var(--accent);
    font-weight: 700;
    font-size: 15px;
}

.option-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
}

/* ---------- 选项按钮（安全问题 / 插曲） ---------- */
.pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill {
    padding: 9px 16px;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.pill:hover {
    border-color: var(--accent);
}

.pill.selected {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pill.correct {
    background: var(--ok);
    border-color: var(--ok);
    color: #fff;
}

.pill.wrong {
    background: var(--err);
    border-color: var(--err);
    color: #fff;
}

/* ---------- 点击匹配挑战（插曲） ---------- */
.match-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.match-tile {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    border: 2px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card);
    user-select: none;
}

.match-tile.text-tile {
    font-size: 22px;
    font-weight: 700;
}

.match-tile.color-tile {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.match-tile.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    transform: scale(1.04);
}

/* ---------- 验证码 ---------- */
.captcha-box {
    padding: 14px;
    border: 1.5px dashed var(--accent);
    border-radius: 12px;
    background: var(--accent-soft);
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: var(--accent-dark);
}

.seq-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.seq-btn {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border: 2px solid var(--border);
    background: var(--card);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

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

.seq-btn.done {
    background: var(--ok);
    color: #fff;
    border-color: var(--ok);
}

/* ---------- 地址核验摘要 ---------- */
.verify-summary {
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--accent-soft);
    border-left: 4px solid var(--accent);
    margin-bottom: 16px;
    font-size: 14px;
}

.verify-summary b {
    color: var(--accent-dark);
}

/* ---------- 导航按钮 ---------- */
.nav-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

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

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1.5px solid var(--border);
}

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

/* ---------- 消息 ---------- */
.message {
    margin-top: 14px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    display: none;
}

.message.error {
    display: block;
    background: rgba(192, 57, 43, 0.1);
    color: var(--err);
    border: 1px solid rgba(192, 57, 43, 0.3);
}

.message.success {
    display: block;
    background: rgba(47, 143, 91, 0.12);
    color: var(--ok);
    border: 1px solid rgba(47, 143, 91, 0.3);
}

/* ---------- 蜜罐（视觉隐藏但保留在 DOM） ---------- */
.honeypot-wrap {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ---------- 成功页 ---------- */
.success-box {
    text-align: center;
    padding: 30px 10px;
}

.success-icon {
    font-size: 58px;
    margin-bottom: 12px;
}

.success-box h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.success-box .order-no {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 700;
    letter-spacing: 1px;
}

/* ---------- 页脚 ---------- */
.foot {
    text-align: center;
    margin-top: 26px;
    color: var(--muted);
    font-size: 12px;
}

.foot-actions {
    margin-top: 10px;
    display: flex;
    gap: 14px;
    justify-content: center;
}

.link-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
}

/* ---------- 响应式 ---------- */
@media (max-width: 560px) {
    .page {
        padding: 16px 12px 36px;
    }

    .order-card {
        padding: 18px 16px;
        border-radius: 16px;
    }

    .option-grid {
        grid-template-columns: 1fr;
    }

    .match-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ---------- 多商品下单（数量选择） ---------- */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.product-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.product-card:has(.qty-input[value]:not([value="0"])) {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.product-info {
    min-width: 0;
    flex: 1;
}

.product-info .option-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.product-info .option-price {
    color: var(--accent);
    font-weight: 700;
    font-size: 15px;
    margin-right: 8px;
}

.product-info .option-max {
    font-size: 12px;
    color: var(--muted);
}

.product-info .stock-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-dark);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    vertical-align: middle;
}

.product-info .stock-badge.sold-out {
    color: #c0392b;
    background: rgba(192, 57, 43, 0.08);
    border-color: #c0392b;
}

.product-card.sold-out {
    opacity: 0.55;
    filter: grayscale(0.4);
}

.product-card.sold-out .qty-btn {
    cursor: not-allowed;
    opacity: 0.5;
}

.qty-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.qty-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--card);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--accent);
    transition: all 0.2s;
    font-family: inherit;
}

.qty-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.qty-input {
    width: 62px;
    text-align: center;
    padding: 8px 4px;
}

.qty-input.hit-max {
    border-color: var(--accent);
    color: var(--accent-dark);
}

.item-summary {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 13px;
    border: 1px dashed var(--accent);
}

.item-summary.has-items {
    border-style: solid;
}

