/* templet7 — 工业蓝企业风（独立命名空间） */
:root {
    --t7-primary: #1e6fd9;
    --t7-primary-dark: #1558b0;
    --t7-accent: #e25b2a;
    --t7-accent-dark: #c94a1f;
    --t7-text: #2c3338;
    --t7-muted: #7a8490;
    --t7-line: #e4e8ec;
    --t7-bg: #f4f6f9;
    --t7-white: #fff;
    --t7-footer: #1b1f24;
    --t7-max: 1200px;
    --t7-radius: 4px;
    --t7-header-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.t7-body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    color: var(--t7-text);
    background: var(--t7-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; }

.t7-container {
    width: min(100% - 32px, var(--t7-max));
    margin-inline: auto;
}

/* Header */
.t7-topbar {
    background: #12263f;
    color: rgba(255,255,255,.75);
    font-size: 12px;
}
.t7-topbar-inner {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.t7-topbar p { margin: 0; }
.t7-topbar a { color: #fff; font-weight: 600; }
.t7-topbar a:hover { color: #9ec5ff; }

.t7-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--t7-white);
    border-bottom: 1px solid var(--t7-line);
}
.t7-header-inner {
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.t7-logo {
    flex-shrink: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: .02em;
}
.t7-logo-text {
    background: linear-gradient(90deg, #1a1a1a 42%, var(--t7-primary) 42%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.t7-logo img {
    max-height: 44px;
    max-width: 170px;
    object-fit: contain;
}
.t7-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0 4px;
}
.t7-nav a {
    padding: 8px 14px;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    transition: color .2s;
}
.t7-nav a:hover,
.t7-nav a.is-active {
    color: var(--t7-accent);
}

.t7-header-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.t7-search-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: #444;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
}
.t7-search-toggle:hover { color: var(--t7-primary); }
.t7-tool-link {
    position: relative;
    font-size: 14px;
    color: #444;
}
.t7-tool-link:hover { color: var(--t7-primary); }
.t7-tool-link em {
    position: absolute;
    top: -8px;
    right: -12px;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    background: var(--t7-accent);
    color: #fff;
    font-size: 10px;
    font-style: normal;
    line-height: 16px;
    text-align: center;
    padding: 0 3px;
}
.t7-search-panel {
    border-top: 1px solid var(--t7-line);
    background: #f7f9fc;
    padding: 12px 0;
}
.t7-search-panel[hidden] { display: none !important; }
.t7-search-form {
    display: flex;
    height: 40px;
    max-width: 520px;
    border: 1px solid var(--t7-line);
    background: #fff;
    overflow: hidden;
}
.t7-search-form input {
    flex: 1;
    border: 0;
    outline: 0;
    padding: 0 14px;
    min-width: 0;
}
.t7-search-form button {
    border: 0;
    background: var(--t7-primary);
    color: #fff;
    padding: 0 18px;
    cursor: pointer;
    font-weight: 600;
}

.t7-menu-btn {
    display: none;
    width: 38px; height: 38px;
    border: 0; background: transparent;
    flex-direction: column; justify-content: center; gap: 5px;
    cursor: pointer; padding: 8px;
}
.t7-menu-btn span { display: block; height: 2px; background: #333; }

/* Main */
.t7-main { min-height: 50vh; }
.t7-main-wide { padding: 0; }
.t7-page { padding: 24px 0 40px; }

/* Buttons */
.t7-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: var(--t7-primary);
    color: #fff !important;
    border: 0;
    border-radius: var(--t7-radius);
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.t7-btn:hover { background: var(--t7-primary-dark); }
.t7-btn:disabled { opacity: .5; cursor: not-allowed; }
.t7-btn-outline {
    background: transparent;
    color: var(--t7-primary) !important;
    border: 1px solid var(--t7-primary);
}
.t7-btn-outline:hover { background: var(--t7-primary); color: #fff !important; }

/* Shared card grid */
.t7-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.t7-card {
    background: var(--t7-white);
    border-radius: var(--t7-radius);
    overflow: hidden;
    border: 1px solid var(--t7-line);
    transition: box-shadow .2s, transform .2s;
}
.t7-card:hover {
    box-shadow: 0 8px 24px rgba(30, 111, 217, .1);
    transform: translateY(-2px);
}
.t7-card-media {
    display: block;
    aspect-ratio: 1;
    background: #eef1f5;
    overflow: hidden;
}
.t7-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s;
}
.t7-card:hover .t7-card-media img { transform: scale(1.04); }
.t7-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #bbb;
    font-size: 13px;
}
.t7-card-body { padding: 14px; }
.t7-card-body h3 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
}
.t7-card-body h3 a:hover { color: var(--t7-primary); }
.t7-card-meta strong {
    color: var(--t7-accent);
    font-size: 16px;
    font-weight: 700;
}

.t7-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--t7-white);
    border-radius: var(--t7-radius);
}
.t7-empty p { color: var(--t7-muted); margin-bottom: 16px; }

.t7-pager {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}
.t7-pager a,
.t7-pager span {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--t7-white);
    border: 1px solid var(--t7-line);
    border-radius: var(--t7-radius);
}
.t7-pager a:hover { border-color: var(--t7-primary); color: var(--t7-primary); }
.t7-pager .is-current {
    background: var(--t7-primary);
    border-color: var(--t7-primary);
    color: #fff;
}

/* Footer */
.t7-footer {
    background: var(--t7-footer);
    color: #9aa3ad;
    margin-top: 0;
}
.t7-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 28px;
    padding: 40px 0;
}
.t7-footer-col h4 {
    margin: 0 0 14px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}
.t7-footer-col ul { list-style: none; margin: 0; padding: 0; }
.t7-footer-col li { margin-bottom: 8px; font-size: 13px; }
.t7-footer-col a:hover { color: #fff; }
.t7-footer-bar {
    border-top: 1px solid #2d3339;
    padding: 16px 0;
    text-align: center;
    font-size: 12px;
}
.t7-footer-bar a { color: #7a8490; }
.t7-footer-bar a:hover { color: #fff; }
.t7-footer-bar p { margin: 4px 0; }

.t7-mobile-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 90;
    display: none;
    grid-template-columns: repeat(4, 1fr);
    background: #fff;
    border-top: 1px solid var(--t7-line);
    height: 52px;
}
.t7-mobile-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #555;
}
.t7-mobile-bar a:hover { color: var(--t7-primary); }

/* Forms / cart / auth utilities */
.section-title {
    font-size: 22px;
    margin: 0 0 20px;
    padding-left: 12px;
    border-left: 4px solid var(--t7-primary);
    font-weight: 700;
}
.btn, .btn-block {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: var(--t7-primary);
    color: #fff !important;
    border: 0;
    border-radius: var(--t7-radius);
    cursor: pointer;
    font-weight: 600;
}
.btn:hover { background: var(--t7-primary-dark); }
.btn-block { width: 100%; }
.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(--t7-radius);
    background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 0;
    border-color: var(--t7-primary);
    box-shadow: 0 0 0 3px rgba(30, 111, 217, .12);
}

/* Auth */
.t7-auth {
    max-width: 560px;
    margin: 28px auto 40px;
}
.t7-auth-panel {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(27, 31, 36, .08);
    border: 1px solid var(--t7-line);
}
.t7-auth-brand {
    padding: 28px 28px 22px;
    background:
        radial-gradient(circle at 90% 10%, rgba(30, 111, 217, .2), transparent 42%),
        linear-gradient(135deg, #1b1f24 0%, #2d3748 100%);
    color: #fff;
}
.t7-auth-brand p {
    margin: 0 0 6px;
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
    opacity: .75;
}
.t7-auth-brand h2 {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 800;
}
.t7-auth-brand span {
    display: block;
    font-size: 13px;
    opacity: .82;
    line-height: 1.5;
}
.t7-auth-body { padding: 24px 28px 28px; }
.t7-auth-tip { margin: 0 0 14px; color: #888; font-size: 13px; }
.t7-auth-form { display: grid; gap: 14px; }
.t7-auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.t7-auth-field label {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 6px;
    color: #666;
    font-size: 13px;
}
.t7-auth-field label em { font-style: normal; color: #aaa; font-size: 12px; }
.t7-auth-field input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: var(--t7-radius);
    background: #fafbfc;
    transition: .15s ease;
}
.t7-auth-field input:focus {
    outline: 0;
    background: #fff;
    border-color: var(--t7-primary);
    box-shadow: 0 0 0 3px rgba(30, 111, 217, .12);
}
.t7-auth-agreements { display: grid; gap: 10px; padding: 4px 0 2px; }
.t7-auth-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    line-height: 1.4;
    font-weight: normal;
}
.t7-auth-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--t7-primary);
}
.t7-auth-check a { color: var(--t7-primary); }
.t7-auth-submit {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: var(--t7-radius);
    background: var(--t7-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
}
.t7-auth-submit:hover { background: var(--t7-primary-dark); }
.t7-auth-foot {
    margin: 18px 0 0;
    text-align: center;
    color: #888;
    font-size: 13px;
}
.t7-auth-foot a { color: var(--t7-primary); font-weight: 600; }

.alert {
    padding: 12px 14px;
    border-radius: var(--t7-radius);
    margin-bottom: 14px;
}
.alert-success { background: #ecfdf5; color: #047857; }
.alert-error { background: #fef2f2; color: #b91c1c; }
.login-notice { color: #888; margin-bottom: 12px; }
.cart-empty, .empty-state {
    text-align: center;
    padding: 48px 16px;
    background: #fff;
    border-radius: 8px;
}
.cart-table-wrap { overflow-x: auto; background: #fff; border-radius: 8px; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td {
    padding: 12px;
    border-bottom: 1px solid var(--t7-line);
    text-align: left;
    vertical-align: middle;
}
.cart-table th { background: #fafbfc; 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: 4px; 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: 4px; }
.qty-btn {
    width: 32px; height: 32px; border: 0; background: #f7f7f7; cursor: pointer;
}
.qty-input { width: 48px; height: 32px; border: 0; text-align: center; }
.cart-summary {
    margin-top: 16px;
    background: #fff;
    padding: 16px 20px;
    border-radius: 8px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.product-card {
    background: #fff;
    border-radius: var(--t7-radius);
    overflow: hidden;
}
.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(--t7-accent); 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; color: var(--t7-accent); }

/* Cart footer / checkout / promo utilities */
.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 16px 20px;
    border-radius: var(--t7-radius);
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
    border: 1px solid var(--t7-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(--t7-accent); font-size: 22px; font-weight: 700; }
.btn-checkout { background: var(--t7-primary); color: #fff !important; padding: 12px 32px; font-size: 16px; }
.btn-checkout:hover { background: var(--t7-primary-dark); }
.btn-link { background: none; border: none; color: #999; cursor: pointer; font-size: 13px; padding: 0; }
.btn-link:hover { color: var(--t7-primary); }
.cart-promo-label { font-size: 12px; color: var(--t7-accent); margin-top: 4px; }
.cart-price, .cart-subtotal { color: var(--t7-accent); font-weight: 600; }

.checkout-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.checkout-section { background: #fff; border-radius: var(--t7-radius); padding: 20px; margin-bottom: 16px; border: 1px solid var(--t7-line); }
.checkout-section h3 { font-size: 16px; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--t7-line); }
.checkout-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--t7-line); }
.checkout-section-head h3 { margin: 0; padding: 0; border: none; }
.checkout-address-link { font-size: 13px; color: var(--t7-primary); }
.checkout-sidebar .checkout-summary { background: #fff; border-radius: var(--t7-radius); padding: 20px; position: sticky; top: 80px; border: 1px solid var(--t7-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(--t7-line); margin-top: 8px; padding-top: 16px; font-size: 16px; font-weight: 600; }
.checkout-total { color: var(--t7-accent); font-size: 22px; }

.promo-tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; color: #fff; line-height: 1.6; }
.promo-tag-flash { background: var(--t7-accent); }
.promo-tag-group { background: var(--t7-primary); }
.promo-page-meta { margin: -8px 0 20px; color: #666; font-size: 14px; }
.product-card .thumb { position: relative; }
.flash-countdown { color: var(--t7-accent); 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(--t7-line); border-radius: var(--t7-radius); padding: 14px 16px;
    cursor: pointer; transition: border-color .2s, background .2s;
}
.address-card.is-selected { border-color: var(--t7-primary); background: #eef4fc; }
.address-card input[type="radio"] { margin-top: 4px; flex-shrink: 0; }
.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(--t7-primary); }
.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; }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.checkbox-label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.required { color: var(--t7-accent); }

.order-success { text-align: center; background: #fff; padding: 48px 20px; border-radius: var(--t7-radius); border: 1px solid var(--t7-line); }
.success-icon {
    width: 64px; height: 64px; line-height: 64px; border-radius: 50%;
    background: #52c41a; color: #fff; font-size: 32px; margin: 0 auto 16px;
}
.order-success h2 { margin-bottom: 12px; }
.success-amount { color: var(--t7-accent); 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(--t7-radius); border: 1px solid var(--t7-line); }
.page-content h1 { margin: 0 0 16px; font-size: 24px; }

/* Home shared sections */
.template-templet7 .home-product-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.template-templet7 .home-product-card {
    background: #fff;
    border-radius: var(--t7-radius);
    overflow: hidden;
    border: 1px solid var(--t7-line);
}
.template-templet7 .home-product-thumb { aspect-ratio: 1; }

@media (max-width: 1024px) {
    .t7-card-grid,
    .product-grid,
    .template-templet7 .home-product-row { grid-template-columns: repeat(3, 1fr); }
    .t7-nav a { padding: 8px 10px; }
}

@media (max-width: 768px) {
    body.t7-body { padding-bottom: 56px; }
    .t7-topbar { display: none; }
    .t7-menu-btn { display: flex; }
    .t7-header { position: relative; }
    .t7-nav {
        display: none;
        position: absolute;
        left: 0; right: 0;
        top: 100%;
        background: #fff;
        border-bottom: 1px solid var(--t7-line);
        flex-direction: column;
        align-items: stretch;
        padding: 8px 16px 16px;
        gap: 0;
        z-index: 101;
    }
    .t7-header.is-nav-open .t7-nav { display: flex; }
    .t7-nav a {
        padding: 12px 8px;
        border-bottom: 1px solid #f2f2f2;
    }
    .t7-card-grid,
    .product-grid,
    .template-templet7 .home-product-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .t7-mobile-bar { display: grid; }
    .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) {
    .t7-auth { margin: 16px auto 32px; }
    .t7-auth-brand, .t7-auth-body { padding-left: 18px; padding-right: 18px; }
    .t7-auth-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .t7-card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .t7-card-body { padding: 10px; }
    .t7-card-body h3 { font-size: 13px; min-height: 0; }
}
