/* ==========================================================================
   商城主题 —— 明亮高级主题（象牙白 + 墨黑 + 香槟金）
   覆盖式，不改原模板 CSS；加载顺序：bootstrap -> base/common/index -> 本文件
   换主色只需改 :root 里的 --accent / --accent-2 / --ink
   ========================================================================== */

:root {
    /* 背景层级（暖象牙白，避免刺眼纯白） */
    --bg:            #f7f6f3;
    --bg-elev:       #ffffff;
    --surface:       #ffffff;
    --surface-2:     #f2f0ea;
    --surface-3:     #e9e6dd;

    /* 描边 */
    --border:        rgba(22, 24, 29, .10);
    --border-strong: rgba(22, 24, 29, .20);

    /* 文字 */
    --text:          #16181d;
    --text-dim:      #4c5464;
    --muted:         #8a92a0;

    /* 品牌色：墨黑 + 香槟金 */
    --ink:           #16181d;
    --ink-2:         #2c313a;
    --accent:        #9a7b4f;               /* 香槟金（文字/描边） */
    --accent-2:      #c2a068;               /* 亮金 */
    --accent-soft:   rgba(154, 123, 79, .10);
    --ink-grad:      linear-gradient(135deg, #1b1e25 0%, #343943 100%);
    --gold-grad:     linear-gradient(135deg, #b8935a 0%, #e2cb96 100%);

    /* 语义色 */
    --success:       #1f7a5a;
    --warning:       #a9660f;
    --danger:        #b5342f;
    --info:          #2563eb;

    /* 形状与阴影 */
    --radius:        16px;
    --radius-sm:     11px;
    --radius-pill:   999px;
    --shadow-sm:     0 1px 2px rgba(22, 24, 29, .05), 0 2px 8px rgba(22, 24, 29, .05);
    --shadow:        0 12px 32px rgba(22, 24, 29, .10);
    --shadow-glow:   0 8px 24px rgba(154, 123, 79, .22);
}

/* --------------------------------------------------------------------------
   1. 全局
   -------------------------------------------------------------------------- */
html { color-scheme: light; scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }

body {
    background:
        radial-gradient(1000px 520px at 10% -10%, rgba(194, 160, 104, .16), transparent 60%),
        radial-gradient(880px 460px at 92% 0%, rgba(22, 24, 29, .07), transparent 58%),
        var(--bg) !important;
    background-attachment: fixed;
    color: var(--text);
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-container { flex: 1 0 auto; }
.notice, .category, .header { flex: 0 0 auto; }
.footer { flex: 0 0 auto; }

a { color: var(--text-dim); transition: color .18s ease; }
a:hover, a:focus { color: var(--accent); text-decoration: none; }

h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 700; letter-spacing: .2px; }
label { color: var(--text-dim); }
hr { border-color: var(--border); }
::selection { background: rgba(194, 160, 104, .32); color: var(--ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: #d6d2c7; border-radius: var(--radius-pill); border: 2px solid var(--surface-2); }
::-webkit-scrollbar-thumb:hover { background: #c2bdaf; }

.text-muted { color: var(--muted) !important; }
small.text-muted { color: var(--muted) !important; }

.container { max-width: 1180px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* --------------------------------------------------------------------------
   2. 页头
   -------------------------------------------------------------------------- */
.header.sticky-top {
    padding: 0;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    z-index: 1030;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 68px;
    flex-wrap: wrap;
    padding: 10px 0;
}

.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; min-width: 0; }
.brand:hover { text-decoration: none; }

.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 12px;
    background: var(--ink-grad);
    box-shadow: 0 6px 16px rgba(22, 24, 29, .22);
    position: relative;
    flex: 0 0 auto;
}
.brand-mark::after {
    content: ""; position: absolute; inset: 0; border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(226, 203, 150, .38);
}
.brand-mark svg { width: 19px; height: 19px; display: block; }
.brand-mark svg path { fill: #e2cb96; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong {
    font-size: 17px; font-weight: 800; color: var(--text);
    letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text small { font-size: 10px; letter-spacing: 2.1px; color: var(--accent); text-transform: uppercase; }
.brand-logo-img { height: 40px; max-width: 190px; object-fit: contain; }

.nav-main { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.nav-main .nav-link {
    color: var(--text-dim); font-size: 14px; padding: 7px 13px;
    border-radius: var(--radius-pill); transition: background .18s ease, color .18s ease;
    white-space: nowrap;
}
.nav-main .nav-link:hover { background: rgba(22, 24, 29, .05); color: var(--text); }
.nav-main .nav-link.active {
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(154, 123, 79, .30);
}

.nav-search { display: flex; gap: 8px; flex: 1 1 230px; max-width: 330px; margin-left: auto; min-width: 0; }
.nav-search .form-control {
    background: #fff; border: 1px solid var(--border); color: var(--text);
    border-radius: var(--radius-pill); padding: 8px 15px; font-size: 13px; min-width: 0;
}
.nav-search .form-control::placeholder { color: var(--muted); }
.nav-search .form-control:focus {
    background: #fff; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(154, 123, 79, .15); color: var(--text);
}
.nav-search .btn {
    border-radius: var(--radius-pill); border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text-dim); padding: 8px 15px; flex: 0 0 auto;
}
.nav-search .btn:hover { background: var(--ink-grad); border-color: transparent; color: #fff; }

/* --------------------------------------------------------------------------
   3. 公告
   -------------------------------------------------------------------------- */
.notice .card {
    background: linear-gradient(120deg, rgba(194, 160, 104, .13), rgba(194, 160, 104, .04));
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-2);
}
.notice .jumbotron { background: transparent; }
.notice h4 { font-size: 15px; color: var(--accent); margin-bottom: 6px; }
.notice .lead { font-size: 13.5px; color: var(--text-dim); margin-bottom: 0; }

/* --------------------------------------------------------------------------
   4. 首页 hero / 分类
   -------------------------------------------------------------------------- */
.category { padding: 46px 0 26px; position: relative; }

.category h3 {
    font-size: 30px; font-weight: 800; line-height: 1.3;
    background: linear-gradient(120deg, #16181d 0%, #6c5a36 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.category .lead { color: var(--muted); font-size: 14px; margin-top: 6px; }

.separator {
    width: 54px; height: 4px; margin: 18px auto 16px; border: 0;
    border-radius: var(--radius-pill); background: var(--gold-grad); position: relative;
}
.separator:after { display: none; }

.category-menus ul.nav-pills,
.category-menus .nav { flex-wrap: wrap; gap: 9px; justify-content: center !important; }
.category-menus li { display: inline-block; margin: 0; }
.category-menus .btn,
.category-menus .nav-link {
    border-radius: var(--radius-pill); border: 1px solid var(--border);
    background: #fff; color: var(--text-dim); font-size: 13px;
    padding: 7px 17px; line-height: 1.5; transition: all .18s ease;
}
.category-menus .btn:hover,
.category-menus .nav-link:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.category-menus .btn.active,
.category-menus .nav-link.active {
    background: var(--gold-grad); border-color: transparent; color: var(--ink);
    font-weight: 700; box-shadow: var(--shadow-glow);
}

/* --------------------------------------------------------------------------
   5. 商品卡片
   -------------------------------------------------------------------------- */
.goods { padding-bottom: 30px; }
.goods-list .row { --bs-gutter-x: 1.1rem; --bs-gutter-y: 1.1rem; justify-content: center; }

.goods-list .card {
    height: 100%; overflow: hidden; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.goods-list .card:hover {
    transform: translateY(-5px);
    border-color: rgba(154, 123, 79, .45);
    box-shadow: var(--shadow);
}

.goods-list .card-img-top {
    width: 100%; aspect-ratio: 4 / 3; object-fit: contain; padding: 6px;
    background:
        radial-gradient(120% 110% at 50% 0%, rgba(194, 160, 104, .14), transparent 70%),
        var(--surface-2);
}

.goods-list .card-body { display: flex; flex-direction: column; gap: 9px; padding: 13px 14px 15px; }
.goods-list .card-title { font-size: 14.5px; font-weight: 700; margin: 0; color: var(--text); }
.goods-list .card h6 { margin: 0; }
.goods-list .card h6 small { font-size: 12px; }

.goods-list .card .btn-outline-success {
    align-self: flex-start; border: 1px solid rgba(31, 122, 90, .38);
    background: rgba(31, 122, 90, .09); color: #17624a;
    border-radius: var(--radius-pill); font-size: 12.5px; padding: 4px 11px; font-weight: 700;
}
.goods-list .card .btn-outline-success:hover { background: rgba(31, 122, 90, .16); }
.goods-list .card .btn-outline-warning {
    align-self: flex-start; border: 1px solid rgba(169, 102, 15, .38);
    background: rgba(169, 102, 15, .09); color: #8a5309;
    border-radius: var(--radius-pill); font-size: 12px; padding: 4px 10px;
}

.goods-list .card .btn-primary.fr {
    float: none !important; width: 100%; margin-top: auto;
    background: var(--ink-grad); border: 0; border-radius: var(--radius-sm);
    color: #fff; font-weight: 600; font-size: 13.5px; padding: 9px 12px;
    box-shadow: 0 6px 16px rgba(22, 24, 29, .20);
}
.goods-list .card .btn-primary.fr:hover { filter: brightness(1.14); }

.goods-list .card .badge,
.badge { font-weight: 600; letter-spacing: .3px; padding: 5px 9px; border-radius: 8px; }
.goods-list .card .badge.bg-success {
    background: rgba(31, 122, 90, .95) !important; color: #fff; border-bottom-right-radius: 10px; top: 0; left: 0;
}
.goods-list .card .badge.bg-warning {
    background: rgba(169, 102, 15, .95) !important; color: #fff; border-bottom-right-radius: 10px; top: 0; left: 0;
}

/* --------------------------------------------------------------------------
   6. 通用卡片 / 表单 / 按钮
   -------------------------------------------------------------------------- */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow-sm);
}
.card-header {
    background: var(--surface-2); border-bottom: 1px solid var(--border);
    color: var(--text); font-weight: 700;
}
.card-title { color: var(--text); }

.form-control, .form-select, textarea.form-control {
    background: #fff; border: 1px solid var(--border-strong); color: var(--text);
    border-radius: var(--radius-sm);
}
.form-control:focus, .form-select:focus, textarea.form-control:focus {
    background: #fff; border-color: var(--accent);
    color: var(--text); box-shadow: 0 0 0 3px rgba(154, 123, 79, .15);
}
.form-control::placeholder { color: var(--muted); }
.input-group-text { background: var(--surface-2); border-color: var(--border); color: var(--text-dim); }

.btn { border-radius: var(--radius-sm); font-weight: 600; transition: all .18s ease; }
.btn-primary {
    background: var(--ink-grad); border: 0; color: #fff;
    box-shadow: 0 6px 16px rgba(22, 24, 29, .20);
}
.btn-primary:hover, .btn-primary:focus { filter: brightness(1.14); color: #fff; }
.btn-outline-primary {
    border: 1px solid rgba(154, 123, 79, .55); color: #7d6238; background: var(--accent-soft);
}
.btn-outline-primary:hover { background: var(--ink-grad); border-color: transparent; color: #fff; }
.btn-outline-secondary, .btn-outline-dark {
    border: 1px solid var(--border-strong); color: var(--text-dim); background: #fff;
}
.btn-outline-secondary:hover, .btn-outline-dark:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-secondary { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface-3); color: var(--text); }
.btn-dark { background: var(--ink-grad); border-color: transparent; color: #fff; }
.btn-dark:hover { color: #fff; filter: brightness(1.14); }
.btn-outline-success { border: 1px solid rgba(31, 122, 90, .45); color: #17624a; background: #fff; }
.btn-outline-success:hover { background: rgba(31, 122, 90, .12); color: #0f4a37; }

.input-group button, .input-group .btn {
    background: var(--surface-2); border-color: var(--border); color: var(--text);
}
.input-group button:hover { background: var(--surface-3); color: var(--text); }

/* --------------------------------------------------------------------------
   7. 商品详情 / 下单页
   -------------------------------------------------------------------------- */
.good-card .card { overflow: hidden; }
.good-card .card-img-top {
    max-height: 330px; width: 100%; object-fit: contain;
    background: linear-gradient(180deg, rgba(194, 160, 104, .12), transparent);
    border-radius: var(--radius) var(--radius) 0 0;
}
.good-card .card-title { font-size: 23px; font-weight: 800; }
.good-card h6 { color: var(--text-dim); }

.pay-methods { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.pay-method {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 10px 15px; border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); background: #fff;
    cursor: pointer; transition: all .18s ease; margin: 0; font-size: 13.5px; color: var(--text-dim);
}
.pay-method:hover { border-color: var(--accent); background: var(--surface-2); color: var(--text); }
.pay-method .form-check-input {
    margin: 0; background-color: #fff; border-color: var(--border-strong); width: 1.05em; height: 1.05em;
}
.pay-method .form-check-input:checked {
    background-color: var(--accent); border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(154, 123, 79, .22);
}
.pay-method:has(.form-check-input:checked) {
    border-color: rgba(154, 123, 79, .65); background: var(--accent-soft); color: var(--text); font-weight: 600;
}

/* --------------------------------------------------------------------------
   8. 结算 / 订单 / 查询 / 支付页
   -------------------------------------------------------------------------- */
.main-container { padding: 26px 0 46px; }

textarea.form-control[rows] {
    background: var(--surface-2); color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px;
}

.nav-pills .nav-link {
    border-radius: var(--radius-pill); border: 1px solid var(--border);
    color: var(--text-dim); background: #fff; margin-right: 7px; font-size: 13px; padding: 7px 15px;
}
.nav-pills .nav-link.active {
    background: var(--gold-grad); border-color: transparent; color: var(--ink); font-weight: 700;
    box-shadow: var(--shadow-glow);
}

/* --------------------------------------------------------------------------
   9. 弹窗
   -------------------------------------------------------------------------- */
.modal-content {
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius); color: var(--text);
    box-shadow: 0 24px 60px rgba(22, 24, 29, .18);
}
.modal-header, .modal-footer { border-color: var(--border); }
.modal-title { color: var(--text); }
.modal-backdrop.show { opacity: .45; background: #1b1e25; }
.btn-close { opacity: .45; }
.btn-close:hover { opacity: .85; }
.modal-dialog { max-width: min(520px, calc(100vw - 1.5rem)); margin: 1rem auto; }

/* --------------------------------------------------------------------------
   10. 页脚
   -------------------------------------------------------------------------- */
.footer {
    margin-top: 30px; padding: 26px 0 34px !important;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, transparent, rgba(22, 24, 29, .025));
    color: var(--muted); font-size: 12.5px;
}
.footer .author a { color: var(--text-dim); }
.footer .author a:hover { color: var(--accent); }
.footer .custom { margin-top: 7px; color: var(--muted); line-height: 1.7; }
.footer .custom a { color: var(--text-dim); }

/* --------------------------------------------------------------------------
   11. 错误页
   -------------------------------------------------------------------------- */
.err-message h5 { color: var(--danger); font-weight: 600; word-break: break-word; }

/* --------------------------------------------------------------------------
   12. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .nav-search { max-width: none; flex: 1 1 100%; margin-left: 0; order: 3; }
    .header-inner { gap: 12px; }
}

@media (max-width: 767.98px) {
    .category { padding: 30px 0 18px; }
    .category h3 { font-size: 22px; }
    .category .lead { font-size: 13px; }
    .main-container { padding: 14px 0 30px; }
    .good-card .card-title { font-size: 19px; }
    .brand-text small { display: none; }
    .brand-mark { width: 34px; height: 34px; }
    .brand-text strong { font-size: 16px; }
    .goods-list .card-body { padding: 11px 12px 13px; }
}

@media (max-width: 479.98px) {
    .goods-list .row-cols-2 > .col { flex: 0 0 100%; width: 100%; max-width: 100%; }
    .goods-list .card-img-top { aspect-ratio: 16 / 11; }
    .container { padding-left: 14px; padding-right: 14px; }
    .modal-dialog { max-width: calc(100vw - 1rem); margin: .5rem auto; }
    .category-menus .btn, .category-menus .nav-link { font-size: 12.5px; padding: 6px 13px; }
}
