:root {
    --bg: #0f172a;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    --radius: 20px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #eef4ff 0%, #f8fafc 260px, #f8fafc 100%);
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}
.topbar {
    min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { font-size: 24px; font-weight: 800; color: var(--primary); }
.nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav a { padding: 10px 14px; border-radius: 999px; color: #334155; }
.nav a:hover { background: #eff6ff; color: var(--primary); }
.page-wrap { padding: 36px 0 60px; }
.hero, .split-layout, .two-column-panel, .inventory-layout { display: grid; gap: 24px; }
.hero, .split-layout { grid-template-columns: 1.3fr 0.9fr; align-items: stretch; }
.two-column-panel { grid-template-columns: 1.15fr 0.85fr; }
.inventory-layout { grid-template-columns: 0.95fr 1.05fr; }
.card, .empty-box {
    background: var(--panel); border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.card { padding: 24px; }
.large-card { padding: 34px; }
.highlight-card { background: linear-gradient(135deg, #eff6ff, #ffffff); }
.hero h1, .section-header h1, .auth-card h1, .success-box h1 {
    margin: 10px 0 12px; font-size: clamp(30px, 4vw, 46px); line-height: 1.1;
}
h2, h3, p { margin-top: 0; }
.eyebrow {
    margin-bottom: 8px; color: var(--primary); font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; font-size: 13px;
}
.hero-text, .muted, .section-header p, .description, .order-item p, .tips-box, .stat-label { color: var(--muted); }
.hero-actions, .action-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn {
    appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 18px; border-radius: 14px; font-weight: 700; transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #eff6ff; color: var(--primary); }
.btn-small { padding: 7px 12px; border-radius: 10px; }
.full { width: 100%; }
.card-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.product-card { display: flex; flex-direction: column; gap: 18px; }
.product-top, .meta-row, .section-header, .order-item, .checkbox-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.meta-row { flex-wrap: wrap; color: #334155; font-size: 14px; }
.badge {
    display: inline-flex; align-items: center; justify-content: center; padding: 6px 12px;
    border-radius: 999px; font-size: 13px; font-weight: 700;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-muted { background: #e2e8f0; color: #475569; }
.badge-primary { background: #dbeafe; color: #1e40af; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.price { font-size: 28px; font-weight: 800; color: var(--primary); }
.section-header { margin: 28px 0 18px; }
.section-header.tight { margin: 0 0 18px; }
.section-header h2, .section-header h1 { margin-bottom: 6px; }
.text-link { color: var(--primary); font-weight: 700; }
.stat-grid { display: grid; gap: 18px; }
.two-col { grid-template-columns: repeat(2, 1fr); }
.three-col { grid-template-columns: repeat(3, 1fr); margin: 24px 0; }
.four-col { grid-template-columns: repeat(4, 1fr); margin: 24px 0; }
.compact { gap: 14px; }
.stat-card strong, .highlight-card strong, .detail-item strong { display: block; margin-top: 8px; font-size: 24px; }
.detail-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.detail-item { padding: 18px; border-radius: 18px; background: var(--panel-soft); border: 1px solid var(--line); }
.form-grid { display: grid; gap: 16px; }
.two-col-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-span { grid-column: 1 / -1; }
label span { display: block; margin-bottom: 10px; font-weight: 700; }
input, textarea, select {
    width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px;
    background: white; color: var(--text);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus {
    outline: none; border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}
.tips-box, .delivery-box, .flash {
    border-radius: 18px; padding: 18px; border: 1px solid var(--line); background: var(--panel-soft);
}
.tips-box ul { margin: 10px 0 0; padding-left: 18px; }
.delivery-box pre, .delivery-preview, .mono { font-family: Consolas, "Courier New", monospace; }
.delivery-box pre, .delivery-preview {
    white-space: pre-wrap; word-break: break-all; background: #0f172a; color: #e2e8f0;
    padding: 16px; border-radius: 16px; margin: 12px 0 0;
}
.delivery-preview { margin: 0; max-width: 320px; }
.flash-list { display: grid; gap: 12px; margin-bottom: 20px; }
.flash-success { background: #ecfdf5; color: #166534; border-color: #bbf7d0; }
.flash-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #475569; font-size: 14px; }
.compact-table table { min-width: 100%; }
.order-list { display: grid; gap: 14px; }
.order-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.right-align { text-align: right; }
.empty-box { padding: 28px; color: var(--muted); }
.empty-box.small { padding: 18px; }
.auth-wrap { min-height: calc(100vh - 180px); display: grid; place-items: center; }
.auth-card { width: min(460px, 100%); }
.form-card.wide { max-width: 920px; }
.success-box { max-width: 920px; margin: 0 auto; }
.wrap { flex-wrap: wrap; }
.checkbox-row { justify-content: flex-start; }
.checkbox-row input { width: auto; }
.compact-detail-grid { margin-top: 20px; }
.top-gap { margin-top: 20px; }
.narrow-wrap { min-height: auto; }
.wider-card { width: min(560px, 100%); }
.inline-alert { margin-top: 16px; }
.security-banner { margin-bottom: 24px; }
.toolbar-form {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}
.toolbar-field { min-width: 220px; }
.grow-field { flex: 1; }
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.checkbox-cell { width: 72px; }
.table-checkbox { width: 18px; height: 18px; }
.muted-note {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}
.status-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}
.timeline-list {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}
.inline-form {
    min-width: 160px;
    display: grid;
    gap: 10px;
}

@media (max-width: 980px) {


    .hero, .split-layout, .two-column-panel, .inventory-layout, .two-col-form, .three-col, .four-col { grid-template-columns: 1fr; }
    .topbar, .section-header, .product-top, .meta-row, .order-item { align-items: flex-start; flex-direction: column; }
    .nav { justify-content: flex-start; }
    .right-align { text-align: left; }
}
