/* ===== 家装报价系统 全局样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #ff6b35;
    --primary-dark: #e5551f;
    --ink: #2b2b2b;
    --muted: #8a8a8a;
    --bg: #f6f4f1;
    --card: #ffffff;
    --line: #ece7e0;
}
body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
a { color: var(--primary); }

/* 头部 */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-size: 18px; font-weight: 700; }
.site-header nav a { margin-left: 24px; color: var(--ink); text-decoration: none; font-size: 14px; }
.site-header nav a:hover { color: var(--primary); }

/* Hero */
.hero {
    background: linear-gradient(135deg, #ff6b35 0%, #f7b733 100%);
    color: #fff; padding: 56px 0 72px; text-align: center;
}
.hero h1 { font-size: 34px; margin-bottom: 10px; }
.hero .hl { background: rgba(255,255,255,.25); padding: 0 10px; border-radius: 8px; }
.hero p { opacity: .92; }

/* 主区域 */
.main-grid {
    display: grid; grid-template-columns: 1fr 340px; gap: 24px;
    margin-top: -40px; align-items: start;
}
.card {
    background: var(--card); border-radius: 14px; padding: 28px;
    box-shadow: 0 6px 24px rgba(0,0,0,.06);
}
.card h2 { font-size: 18px; margin: 22px 0 14px; }
.card h2:first-child { margin-top: 0; }

/* 表单 */
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.label-tip { font-weight: 400; color: var(--muted); font-size: 12px; }
.field input[type=text], .field input[type=tel], .field input[type=number], .field select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
    font-size: 15px; font-family: inherit; background: #fbfaf8; transition: border .2s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); background: #fff; }

/* 档次卡片 */
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-card input { position: absolute; opacity: 0; }
.rc-body {
    display: block; border: 1.5px solid var(--line); border-radius: 10px;
    padding: 12px 14px; cursor: pointer; transition: all .15s;
}
.rc-body b { display: block; font-size: 15px; }
.rc-body em { color: var(--primary); font-style: normal; font-size: 13px; }
.rc-body small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.radio-card input:checked + .rc-body {
    border-color: var(--primary); background: #fff7f2;
    box-shadow: 0 0 0 3px rgba(255,107,53,.12);
}

/* 增项（含数量设置） */
.extras-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.extra-item {
    border: 1.5px solid var(--line); border-radius: 10px;
    transition: all .15s; overflow: hidden;
}
.extra-item.active { border-color: var(--primary); background: #fff7f2; }
.extra-head { display: block; cursor: pointer; padding: 10px 12px; }
.extra-head input { position: absolute; opacity: 0; }
.extra-head span { display: block; font-size: 14px; }
.extra-head b { font-weight: 600; }
.extra-head em { display: block; color: var(--muted); font-style: normal; font-size: 12px; }
.extra-item .qty-row {
    display: none; align-items: center; gap: 6px;
    padding: 6px 12px 10px; font-size: 12px; color: var(--muted);
}
.extra-item.active .qty-row { display: flex; }
.qty-input {
    width: 70px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px;
    font-size: 13px; font-family: inherit; text-align: center; background: #fff;
}
.qty-input:focus { outline: none; border-color: var(--primary); }
.qty-row i { font-style: normal; }
.brand-row select {
    flex: 1; min-width: 0; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px;
    font-size: 13px; font-family: inherit; background: #fff; color: var(--text);
}
.brand-row select:focus { outline: none; border-color: var(--primary); }

/* 按钮 */
.btn-primary {
    width: 100%; padding: 14px; border: none; border-radius: 10px;
    background: var(--primary); color: #fff; font-size: 17px; font-weight: 700;
    cursor: pointer; transition: background .2s;
}
.btn-primary:hover { background: var(--primary-dark); }
.form-tip { text-align: center; color: var(--muted); font-size: 12px; margin-top: 10px; }

/* 实时预估 */
.result-card { position: sticky; top: 80px; }
.total-box {
    background: linear-gradient(135deg, #ff6b35, #f7b733);
    border-radius: 12px; color: #fff; text-align: center; padding: 20px 12px;
}
.total-num { font-size: 34px; font-weight: 800; margin: 4px 0; }
.total-box .muted { color: rgba(255,255,255,.85); }
.breakdown { list-style: none; margin: 16px 0; }
.breakdown li {
    display: flex; justify-content: space-between; padding: 8px 0;
    border-bottom: 1px dashed var(--line); font-size: 14px;
}
.breakdown li em { font-style: normal; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* 流程 */
.flow { padding: 56px 20px; }
.flow h2 { text-align: center; margin-bottom: 28px; }
.flow-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.flow-item { background: #fff; border-radius: 12px; padding: 22px 18px; text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,.04); }
.flow-item i {
    display: inline-block; width: 36px; height: 36px; line-height: 36px;
    border-radius: 50%; background: var(--primary); color: #fff;
    font-style: normal; font-weight: 700; margin-bottom: 10px;
}
.flow-item b { display: block; margin-bottom: 4px; }
.flow-item p { font-size: 13px; color: var(--muted); }

/* 页脚 */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0; text-align: center; color: var(--muted); font-size: 13px; background: #fff; }
.footer-links { margin-top: 6px; font-size: 12px; }
.footer-links a { color: #8a8a8a; text-decoration: none; }
.footer-links a:hover { color: var(--primary); }
.footer-links span { margin: 0 8px; color: #d8d8d8; }

/* 协议同意勾选 */
.agree-row { margin-top: 4px; }
.agree-label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-weight: 400 !important; }
.agree-label input[type=checkbox] { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--primary); }
.agree-label span { font-size: 13px; color: #666; line-height: 1.6; }

/* 协议文档页 */
.doc-page { padding-bottom: 40px; }
.doc-card { max-width: 780px; margin: 24px auto 0; padding: 40px 44px; }
.doc-title { text-align: center; font-size: 26px; }
.doc-updated { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 28px; }
.doc-sec { margin-bottom: 22px; }
.doc-sec h3 { font-size: 16px; margin-bottom: 8px; }
.doc-sec p { font-size: 14px; color: #444; line-height: 1.9; margin-bottom: 6px; text-align: justify; }
.doc-end { text-align: center; color: #b0b0b0; font-size: 13px; margin-top: 28px; }

/* 安装页 / 结果页 */
.install-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; }
.install-card {
    background: #fff; border-radius: 14px; padding: 34px; max-width: 620px;
    width: 100%; box-shadow: 0 8px 30px rgba(0,0,0,.08);
}
.install-card h1 { font-size: 22px; margin-bottom: 16px; }
.step-list { list-style: none; margin: 12px 0 18px; }
.step-list li { padding: 6px 0; font-size: 14px; }
.step-list .pass { color: #27ae60; }
.step-list .fail { color: #c0392b; }
.install-tips { border-top: 1px solid var(--line); padding-top: 14px; font-size: 14px; }
.install-tips code { background: #f2efe9; padding: 1px 6px; border-radius: 4px; }

/* 报价明细表 */
.detail-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.detail-table th {
    text-align: left; background: #faf6f1; padding: 8px 10px;
    border: 1px solid var(--line);
}
.detail-table td { padding: 8px 10px; border: 1px solid var(--line); }
.detail-table .sum td { font-weight: 700; color: var(--primary); }
.quote-result { max-width: 560px; }
.result-actions { display: flex; gap: 12px; margin-top: 18px; align-items: center; }
.result-actions .btn-primary { width: auto; padding: 12px 24px; }

/* 分享区 */
.share-box { border-top: 1px dashed var(--line); margin-top: 24px; padding-top: 18px; }
.share-box h3 { font-size: 16px; margin-bottom: 14px; }
.share-body { display: flex; gap: 16px; align-items: flex-start; }
.share-qr { text-align: center; flex-shrink: 0; }
.share-qr img { border: 1px solid var(--line); border-radius: 8px; display: block; margin-bottom: 4px; }
.share-info { flex: 1; }
.share-info textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 8px;
    padding: 10px; font-size: 13px; font-family: inherit; color: #555;
    background: #fbfaf8; resize: none;
}
.share-btns { display: flex; gap: 10px; margin: 10px 0; }
.share-card { max-width: 560px; }
.share-head { display: flex; gap: 14px; align-items: center; }
.share-head h1 { font-size: 20px; margin: 0; }
.share-avatar {
    width: 52px; height: 52px; border-radius: 50%; background: #fff3ec;
    display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0;
}
@media (max-width: 480px) {
    .share-body { flex-direction: column; align-items: center; }
}

/* ===== 管理后台 ===== */
.admin-body { background: #f3f1ee; min-height: 100vh; }
.admin-topbar {
    background: #2b2b2b; color: #fff; display: flex; align-items: center;
    justify-content: space-between; padding: 0 24px; height: 56px;
}
.admin-topbar .brand { font-weight: 700; }
.admin-topbar a { color: #f7b733; text-decoration: none; font-size: 14px; margin-left: 18px; }
.admin-wrap { max-width: 1100px; margin: 26px auto; padding: 0 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 3px 10px rgba(0,0,0,.04); }
.stat-card small { color: var(--muted); }
.stat-card .num { font-size: 28px; font-weight: 800; margin-top: 4px; }
.stat-card .num.orange { color: var(--primary); }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 3px 10px rgba(0,0,0,.04); font-size: 14px; }
.admin-table th, .admin-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.admin-table th { background: #faf7f3; font-weight: 600; }
.admin-table tr:hover td { background: #fffaf5; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.badge-0 { background: #fff3e0; color: #e67e22; }
.badge-1 { background: #e3f2fd; color: #1976d2; }
.badge-2 { background: #e8f5e9; color: #2e7d32; }
.badge-3 { background: #f5f5f5; color: #888; }

.btn-sm {
    display: inline-block; padding: 4px 12px; border-radius: 6px; border: 1px solid var(--line);
    background: #fff; font-size: 13px; cursor: pointer; text-decoration: none; color: var(--ink);
}
.btn-sm:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger:hover { border-color: #c0392b; color: #c0392b; }

.admin-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 3px 10px rgba(0,0,0,.04); margin-bottom: 24px; }
.admin-card h3 { margin-bottom: 14px; font-size: 16px; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-bar a { text-decoration: none; color: var(--ink); font-size: 14px; padding: 5px 14px; border-radius: 20px; border: 1px solid var(--line); background: #fff; }
.filter-bar a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.login-box { max-width: 380px; margin: 100px auto; background: #fff; border-radius: 14px; padding: 34px; box-shadow: 0 8px 30px rgba(0,0,0,.08); }
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 20px; }
.alert { background: #fdecea; color: #c0392b; padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.pagination { margin-top: 16px; display: flex; gap: 8px; }
.pagination a, .pagination span { padding: 5px 12px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-size: 13px; text-decoration: none; color: var(--ink); }
.pagination span { background: var(--primary); color: #fff; border-color: var(--primary); }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 7px 18px; border-radius: 20px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 14px; }
.tabs a.active { background: #2b2b2b; color: #fff; border-color: #2b2b2b; }

/* 响应式 */
@media (max-width: 900px) {
    .main-grid { grid-template-columns: 1fr; }
    .result-card { position: static; }
    .flow-grid, .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .radio-cards, .field-row { grid-template-columns: 1fr; }
    .hero h1 { font-size: 26px; }
}

html { scroll-behavior: smooth; }
.admin-card.editing { border: 2px solid var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
