/* templet8 — 深蓝建材企业风 */
:root {
    --t8-nav: #004098;
    --t8-nav-dark: #003070;
    --t8-accent: #0088d2;
    --t8-hotline: #e53935;
    --t8-topbar: #f0f0f0;
    --t8-bg: #f5f5f5;
    --t8-footer: #222;
    --t8-text: #333;
    --t8-muted: #777;
    --t8-line: #e0e0e0;
    --t8-white: #fff;
    --t8-max: 1200px;
    --t8-radius: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.t8-body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--t8-text);
    background: var(--t8-bg);
    font-size: 14px;
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

.t8-wrap {
    width: min(100% - 32px, var(--t8-max));
    margin-inline: auto;
}

/* Topbar */
.t8-topbar {
    background: var(--t8-topbar);
    border-bottom: 1px solid #e5e5e5;
    font-size: 12px;
    color: #666;
}
.t8-topbar-inner {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.t8-topbar p { margin: 0; }
.t8-topbar-links {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.t8-topbar-links a:hover { color: var(--t8-accent); }

/* Header */
.t8-header {
    background: var(--t8-white);
    border-bottom: 1px solid var(--t8-line);
}
.t8-header-inner {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.t8-logo { flex-shrink: 0; }
.t8-logo img { max-height: 52px; max-width: 200px; object-fit: contain; }
.t8-logo-text {
    font-size: 28px;
    font-weight: 800;
    color: var(--t8-nav);
    letter-spacing: .04em;
}
.t8-hotline { text-align: right; }
.t8-hotline-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}
.t8-hotline-num {
    font-size: 26px;
    font-weight: 800;
    color: var(--t8-hotline);
    letter-spacing: .02em;
}
.t8-hotline-num:hover { opacity: .85; }

/* Navbar */
.t8-navbar {
    background: var(--t8-nav);
    position: sticky;
    top: 0;
    z-index: 100;
}
.t8-navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
}
.t8-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}
.t8-nav a {
    display: block;
    padding: 0 22px;
    line-height: 48px;
    color: rgba(255,255,255,.88);
    font-size: 15px;
    transition: background .2s, color .2s;
}
.t8-nav a:hover,
.t8-nav a.is-active {
    background: var(--t8-accent);
    color: #fff;
}
.t8-navbar-tools {
    display: flex;
    align-items: center;
    gap: 16px;
}
.t8-nav-tool {
    color: rgba(255,255,255,.9);
    font-size: 13px;
    position: relative;
}
.t8-nav-tool:hover { color: #fff; }
.t8-nav-tool em {
    position: absolute;
    top: -10px;
    right: -12px;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    background: var(--t8-hotline);
    color: #fff;
    font-size: 10px;
    font-style: normal;
    line-height: 16px;
    text-align: center;
    padding: 0 3px;
}
.t8-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
}
.t8-menu-btn span {
    display: block;
    height: 2px;
    background: #fff;
}

/* Main */
.t8-main { min-height: 50vh; }
.t8-main-wide { padding: 0; }
.t8-page { padding: 24px 0 40px; }

/* Buttons */
.t8-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: var(--t8-accent);
    color: #fff !important;
    border: 0;
    border-radius: var(--t8-radius);
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.t8-btn:hover { background: #0070b0; }

/* Footer */
.t8-footer {
    background: var(--t8-footer);
    color: rgba(255,255,255,.75);
    margin-top: 40px;
}
.t8-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 28px;
    padding: 36px 0 28px;
}
.t8-footer-col h4 {
    margin: 0 0 14px;
    color: #fff;
    font-size: 15px;
}
.t8-footer-col ul { list-style: none; margin: 0; padding: 0; }
.t8-footer-col li { margin-bottom: 8px; }
.t8-footer-col a:hover { color: var(--t8-accent); }
.t8-footer-bar {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 16px 0;
    text-align: center;
    font-size: 12px;
}
.t8-footer-bar p { margin: 4px 0; }
.t8-footer-bar a { color: rgba(255,255,255,.6); }
.t8-footer-bar a:hover { color: #fff; }

/* Mobile bar */
.t8-mobile-bar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    grid-template-columns: repeat(4, 1fr);
    background: #fff;
    border-top: 1px solid var(--t8-line);
    height: 52px;
}
.t8-mobile-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #555;
}
.t8-mobile-bar a:hover { color: var(--t8-accent); }

/* Shared utilities */
.section-title {
    font-size: 22px;
    margin: 0 0 20px;
    padding-left: 12px;
    border-left: 4px solid var(--t8-nav);
    font-weight: 700;
}
.btn, .btn-block {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: var(--t8-accent);
    color: #fff !important;
    border: 0;
    border-radius: var(--t8-radius);
    cursor: pointer;
    font-weight: 600;
}
.btn:hover { background: #0070b0; }
.btn-block { width: 100%; }
.btn-primary { background: var(--t8-nav); }
.btn-primary:hover { background: var(--t8-nav-dark); }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; color: #666; font-size: 13px; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: var(--t8-radius);
    background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 0;
    border-color: var(--t8-accent);
    box-shadow: 0 0 0 3px rgba(0, 136, 210, .12);
}

/* Auth */
.t8-auth { max-width: 560px; margin: 28px auto 40px; }
.t8-auth-panel {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0,0,0,.08);
    border: 1px solid var(--t8-line);
}
.t8-auth-brand {
    padding: 28px;
    background: linear-gradient(135deg, var(--t8-nav) 0%, #005cb8 100%);
    color: #fff;
}
.t8-auth-brand p {
    margin: 0 0 6px;
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .8;
}
.t8-auth-brand h2 { margin: 0 0 8px; font-size: 26px; font-weight: 800; }
.t8-auth-brand span { display: block; font-size: 13px; opacity: .85; }
.t8-auth-body { padding: 24px 28px 28px; }
.t8-auth-tip { margin: 0 0 14px; color: #888; font-size: 13px; }
.t8-auth-form { display: grid; gap: 14px; }
.t8-auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.t8-auth-field label {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    color: #666;
    font-size: 13px;
}
.t8-auth-field label em { font-style: normal; color: #aaa; font-size: 12px; }
.t8-auth-field input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: var(--t8-radius);
    background: #fafafa;
}
.t8-auth-field input:focus {
    outline: 0;
    background: #fff;
    border-color: var(--t8-accent);
}
.t8-auth-agreements { display: grid; gap: 10px; }
.t8-auth-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    font-size: 13px;
    cursor: pointer;
}
.t8-auth-check input { width: 16px; height: 16px; accent-color: var(--t8-accent); }
.t8-auth-check a { color: var(--t8-accent); }
.t8-auth-submit {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: var(--t8-radius);
    background: var(--t8-nav);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.t8-auth-submit:hover { background: var(--t8-nav-dark); }
.t8-auth-foot { margin: 18px 0 0; text-align: center; color: #888; font-size: 13px; }
.t8-auth-foot a { color: var(--t8-accent); font-weight: 600; }

.alert { padding: 12px 14px; border-radius: var(--t8-radius); margin-bottom: 14px; }
.alert-success { background: #ecfdf5; color: #047857; }
.alert-error { background: #fef2f2; color: #b91c1c; }

/* Cart / checkout */
.cart-empty, .empty-state {
    text-align: center;
    padding: 48px 16px;
    background: #fff;
    border-radius: 4px;
}
.cart-table-wrap { overflow-x: auto; background: #fff; border-radius: 4px; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td {
    padding: 12px;
    border-bottom: 1px solid var(--t8-line);
    text-align: left;
    vertical-align: middle;
}
.cart-table th { background: #fafafa; font-size: 13px; color: #666; }
.cart-product-link { display: flex; align-items: center; gap: 12px; }
.cart-product-link img, .cart-product .no-thumb {
    width: 64px; height: 64px; object-fit: cover; border-radius: 3px; background: #eee;
}
.cart-product .no-thumb {
    display: flex; align-items: center; justify-content: center; font-size: 12px; color: #bbb;
}
.qty-control { display: inline-flex; align-items: center; border: 1px solid #ddd; border-radius: 3px; }
.qty-btn { width: 32px; height: 32px; border: 0; background: #f7f7f7; cursor: pointer; }
.qty-input { width: 48px; height: 32px; border: 0; text-align: center; }
.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 16px 20px;
    border-radius: var(--t8-radius);
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
    border: 1px solid var(--t8-line);
}
.cart-footer-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cart-total-label { font-size: 14px; }
.cart-total-price { color: var(--t8-hotline); font-size: 22px; font-weight: 700; }
.btn-checkout { background: var(--t8-nav); color: #fff !important; padding: 12px 32px; font-size: 16px; }
.btn-checkout:hover { background: var(--t8-nav-dark); }
.btn-link { background: none; border: none; color: #999; cursor: pointer; font-size: 13px; padding: 0; }
.btn-link:hover { color: var(--t8-accent); }
.cart-promo-label { font-size: 12px; color: var(--t8-hotline); margin-top: 4px; }
.cart-price, .cart-subtotal { color: var(--t8-hotline); font-weight: 600; }

.checkout-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.checkout-section {
    background: #fff;
    border-radius: var(--t8-radius);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--t8-line);
}
.checkout-section h3 { font-size: 16px; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--t8-line); }
.checkout-section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--t8-line);
}
.checkout-section-head h3 { margin: 0; padding: 0; border: none; }
.checkout-address-link { font-size: 13px; color: var(--t8-accent); }
.checkout-sidebar .checkout-summary {
    background: #fff; border-radius: var(--t8-radius); padding: 20px;
    position: sticky; top: 60px; border: 1px solid var(--t8-line);
}
.checkout-summary h3 { font-size: 16px; margin-bottom: 16px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.summary-row.total { border-top: 1px solid var(--t8-line); margin-top: 8px; padding-top: 16px; font-weight: 600; }
.checkout-total { color: var(--t8-hotline); font-size: 22px; }

.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.product-card { background: #fff; border-radius: var(--t8-radius); overflow: hidden; border: 1px solid var(--t8-line); }
.product-card .info { padding: 12px; }
.product-card .title {
    font-size: 14px; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card .price { color: var(--t8-hotline); font-weight: 700; }
.product-card .price .original { color: #bbb; font-weight: 400; font-size: 12px; margin-left: 6px; text-decoration: line-through; }
.no-thumb-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: #bbb; font-size: 13px; }
.product-promo-line { margin-top: 6px; font-size: 12px; }
.promo-tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; color: #fff; }
.promo-tag-flash { background: var(--t8-hotline); }
.promo-tag-group { background: var(--t8-nav); }
.promo-page-meta { margin: -8px 0 20px; color: #666; font-size: 14px; }
.product-card .thumb { position: relative; }
.flash-countdown { color: var(--t8-hotline); font-weight: 600; margin-left: 8px; }

.address-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.address-card {
    display: flex; align-items: flex-start; gap: 10px;
    border: 1px solid var(--t8-line); border-radius: var(--t8-radius); padding: 14px 16px;
    cursor: pointer;
}
.address-card.is-selected { border-color: var(--t8-accent); background: #f0f8fd; }
.address-card input[type="radio"] { margin-top: 4px; }
.address-card-content { flex: 1; min-width: 0; }
.address-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.address-card-content p { color: #666; font-size: 14px; line-height: 1.6; word-break: break-all; }
.address-card-new strong { color: var(--t8-accent); }
.address-manual-fields.is-hidden { display: none; }
.address-save-options { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 4px; font-size: 14px; color: #666; }
.address-save-actions { display: flex; gap: 10px; margin-top: 14px; }
.checkbox-label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.required { color: var(--t8-hotline); }

.order-success { text-align: center; background: #fff; padding: 48px 20px; border-radius: var(--t8-radius); border: 1px solid var(--t8-line); }
.success-icon {
    width: 64px; height: 64px; line-height: 64px; border-radius: 50%;
    background: #52c41a; color: #fff; font-size: 32px; margin: 0 auto 16px;
}
.success-amount { color: var(--t8-hotline); font-size: 20px; }
.success-tip { color: #999; margin: 12px 0 24px; }
.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.page-content { background: #fff; padding: 24px; border-radius: var(--t8-radius); border: 1px solid var(--t8-line); }
.page-content h1 { margin: 0 0 16px; font-size: 24px; }

.template-templet8 .home-product-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.template-templet8 .home-product-card { background: #fff; border-radius: var(--t8-radius); overflow: hidden; border: 1px solid var(--t8-line); }
.template-templet8 .home-product-thumb { aspect-ratio: 1; }

@media (max-width: 1024px) {
    .product-grid,
    .template-templet8 .home-product-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    body.t8-body { padding-bottom: 56px; }
    .t8-topbar { display: none; }
    .t8-header-inner { min-height: 64px; }
    .t8-hotline-num { font-size: 20px; }
    .t8-menu-btn { display: flex; }
    .t8-navbar { position: relative; }
    .t8-nav {
        display: none;
        position: absolute;
        left: 0; right: 0;
        top: 100%;
        background: var(--t8-nav-dark);
        flex-direction: column;
        z-index: 101;
        box-shadow: 0 8px 16px rgba(0,0,0,.15);
    }
    .t8-navbar.is-nav-open .t8-nav { display: flex; }
    .t8-nav a { line-height: 44px; border-bottom: 1px solid rgba(255,255,255,.08); }
    .t8-mobile-bar { display: grid; }
    .product-grid,
    .template-templet8 .home-product-row { grid-template-columns: repeat(2, 1fr); }
    .checkout-layout { grid-template-columns: 1fr; }
    .cart-footer { flex-direction: column; align-items: stretch; }
    .cart-footer-right { justify-content: space-between; }
}

@media (max-width: 640px) {
    .t8-auth { margin: 16px auto 32px; }
    .t8-auth-row { grid-template-columns: 1fr; }
}
