/* ========== 数码产品报价系统 全站样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --yellow: #ffea00;
    --yellow-soft: #fff7b0;
    --red: #d7000f;
    --dark: #222;
    --gray: #666;
    --line: #d9d9d9;
    --blue: #1677ff;
    --green: #15a05f;
    --bg: #f5f6f8;
}
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    color: var(--dark);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.6;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: #aaa; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶部报价单抬头 ---------- */
.quote-header {
    background: var(--yellow);
    border-bottom: 3px solid var(--red);
    padding: 14px 0 10px;
}
.quote-header .topline {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 8px; font-size: 13px; color: #5a4d00;
}
.quote-header .title-row {
    display: flex; justify-content: space-between; align-items: flex-end;
    flex-wrap: wrap; gap: 10px; margin-top: 6px;
}
.quote-header h1 { font-size: 30px; color: var(--red); letter-spacing: 1px; }
.quote-header .date-badge {
    font-size: 40px; font-weight: 900; color: var(--red);
    font-style: italic; line-height: 1; white-space: nowrap;
}
.quote-header .contact-line { font-size: 20px; font-weight: 700; color: var(--dark); }
.quote-header .contact-line .phones { color: var(--red); font-size: 24px; }
.notice-bar {
    background: var(--red); color: #fff; text-align: center;
    font-weight: 700; padding: 7px 12px; font-size: 15px;
}
.announce-bar {
    background: #fffbe6; border-bottom: 1px solid #f0e2a0;
    color: #6b5a00; font-size: 13px; padding: 6px 12px; text-align: center;
}

/* ---------- 工具条 ---------- */
.toolbar {
    position: sticky; top: 0; z-index: 50;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.toolbar-inner {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 0;
}
.toolbar .brand { font-weight: 700; color: var(--red); margin-right: 8px; white-space: nowrap; }
.toolbar input[type="text"], .toolbar select {
    padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px;
    font-size: 14px; outline: none; background: #fff;
}
.toolbar input[type="text"] { min-width: 220px; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--blue); }
.toolbar .spacer { flex: 1; }
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 0 4px; }
.cat-chips a {
    display: inline-block; padding: 3px 12px; border-radius: 999px;
    background: #f0f0f0; color: #444; font-size: 13px;
}
.cat-chips a.active, .cat-chips a:hover { background: var(--yellow); color: var(--dark); text-decoration: none; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block; padding: 8px 18px; border-radius: 6px;
    border: 1px solid transparent; background: #e8e8e8; color: #333;
    font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-yellow { background: var(--yellow); color: var(--dark); font-weight: 700; }
.btn-green { background: var(--green); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 4px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- 报价表 ---------- */
.quote-wrap { padding: 18px 0 40px; }
.cat-section { margin-bottom: 26px; scroll-margin-top: 90px; }
.cat-section h2 {
    background: var(--yellow); border-left: 6px solid var(--red);
    padding: 8px 14px; font-size: 18px; border-radius: 0 6px 6px 0;
    margin-bottom: 0;
}
.cat-section h2 .count { font-size: 13px; color: #7a6a00; font-weight: 400; margin-left: 8px; }
.table-scroll { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-top: none; }
table.quote-table { width: 100%; border-collapse: collapse; min-width: 720px; }
table.quote-table th, table.quote-table td {
    border: 1px solid var(--line); padding: 8px 12px; text-align: left;
    vertical-align: middle;
}
table.quote-table thead th {
    background: #fafafa; font-weight: 700; text-align: center;
    position: sticky; top: 0;
}
table.quote-table tbody tr:nth-child(even) { background: #fafafa; }
table.quote-table tbody tr:hover { background: #fffce0; }
.col-idx { width: 46px; text-align: center; color: #999; }
.col-name { width: 34%; font-weight: 600; }
.col-spec { width: 30%; color: #555; font-size: 14px; }
.col-official { width: 100px; text-align: center; color: #888; white-space: nowrap; }
.col-price { width: 26%; background: var(--yellow-soft); text-align: center; white-space: nowrap; }
.price-num { color: var(--red); font-weight: 700; font-family: Consolas, monospace; }
.price-sep { color: #c8b400; margin: 0 3px; }
.price-txt { color: var(--red); font-weight: 700; }
.oos {
    display: inline-block; background: var(--red); color: #fff;
    font-size: 12px; border-radius: 3px; padding: 0 6px; font-style: normal;
}
.empty-tip { text-align: center; padding: 60px 20px; color: #999; }
.quote-footer {
    background: #fff; border-top: 2px solid var(--red);
    padding: 16px 0; font-size: 13px; color: #666; text-align: center;
}

/* ---------- 登录/注册 ---------- */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #fff35c 0%, #ffd800 45%, #ffb300 100%);
    padding: 20px;
}
.auth-card {
    width: 100%; max-width: 400px; background: #fff; border-radius: 14px;
    box-shadow: 0 18px 50px rgba(120, 90, 0, .25); padding: 34px 30px;
}
.auth-card .logo { text-align: center; }
.auth-card .logo .big { font-size: 26px; font-weight: 900; color: var(--red); }
.auth-card .logo .sub { color: #888; font-size: 13px; margin-top: 4px; }
.auth-card .role-tag {
    display: block; text-align: center; margin: 14px 0 20px;
    background: var(--yellow); color: #5a4d00; border-radius: 6px;
    padding: 5px; font-size: 13px; font-weight: 700;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; font-weight: 700; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #d0d0d0;
    border-radius: 7px; font-size: 15px; outline: none; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--blue); }
.form-group textarea { min-height: 90px; resize: vertical; }
/* 图形验证码 */
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input { flex: 1; letter-spacing: 2px; text-transform: none; }
.captcha-img {
    height: 42px; width: 132px; border: 1px solid #d0d0d0; border-radius: 7px;
    cursor: pointer; background: #fffd; user-select: none; flex-shrink: 0;
}
.captcha-img:hover { border-color: var(--blue); }
.btn-block { width: 100%; padding: 11px; font-size: 16px; }
.auth-alt { text-align: center; margin-top: 16px; font-size: 13px; color: #888; }
.auth-tip {
    margin-top: 18px; background: #fafafa; border-radius: 7px;
    padding: 10px 12px; font-size: 12px; color: #999; line-height: 1.8;
}

/* ---------- 提示信息 ---------- */
.alert { padding: 10px 14px; border-radius: 7px; margin-bottom: 14px; font-size: 14px; }
.alert-error { background: #fff1f0; border: 1px solid #ffccc7; color: var(--red); }
.alert-ok { background: #f6ffed; border: 1px solid #b7eb8f; color: var(--green); }

/* ---------- 后台布局 ---------- */
.admin-body { display: flex; min-height: 100vh; }
.admin-side {
    width: 210px; background: #1f2733; color: #c8d0dc;
    flex-shrink: 0; display: flex; flex-direction: column;
}
.admin-side .side-logo {
    padding: 20px 18px; font-size: 17px; font-weight: 800; color: var(--yellow);
    border-bottom: 1px solid #313b4a;
}
.admin-side a.nav-item {
    display: block; padding: 13px 20px; color: #c8d0dc; font-size: 14px;
    border-left: 3px solid transparent;
}
.admin-side a.nav-item:hover { background: #2a3340; text-decoration: none; }
.admin-side a.nav-item.active { background: #2a3340; border-left-color: var(--yellow); color: #fff; }
.admin-side .side-foot { margin-top: auto; padding: 16px 20px; font-size: 12px; border-top: 1px solid #313b4a; }
.admin-side .side-foot a { color: #9aa6b5; display: block; margin-top: 6px; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-footer {
    margin-top: auto; padding: 14px 24px; text-align: center;
    color: #999; font-size: 13px; border-top: 1px solid var(--line);
}
.admin-footer p { margin: 0; }
.admin-top {
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 14px 24px; display: flex; align-items: center; justify-content: space-between;
}
.admin-top h2 { font-size: 19px; }
.admin-content { padding: 22px 24px; }
.card {
    background: #fff; border: 1px solid var(--line); border-radius: 10px;
    padding: 20px; margin-bottom: 20px;
}
.card h3 { font-size: 16px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.stat-box { background: #fff; border-radius: 10px; padding: 20px; border: 1px solid var(--line); }
.stat-box .num { font-size: 30px; font-weight: 800; color: var(--red); }
.stat-box .label { color: #888; font-size: 13px; margin-top: 4px; }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.admin-table th, table.admin-table td { border: 1px solid #e5e5e5; padding: 8px 10px; text-align: left; }
table.admin-table th { background: #fafafa; white-space: nowrap; }
table.admin-table tbody tr:hover { background: #fffce0; }
.actions { white-space: nowrap; text-align: center; }
.actions .btn { margin: 0 2px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-bar input, .filter-bar select {
    padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px;
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 160px; gap: 14px; }
.pill { display: inline-block; background: #eef4ff; color: var(--blue); border-radius: 999px; padding: 1px 10px; font-size: 12px; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
    .quote-header h1 { font-size: 22px; }
    .quote-header .date-badge { font-size: 28px; }
    .quote-header .contact-line { font-size: 15px; }
    .quote-header .contact-line .phones { font-size: 18px; }
    .admin-side { width: 64px; }
    .admin-side .side-logo span, .admin-side a.nav-item span, .admin-side .side-foot a span { display: none; }
    .admin-side a.nav-item { text-align: center; padding: 14px 8px; font-size: 12px; }
    .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}
