:root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --border: #e3e6ea;
    --text: #24292f;
    --muted: #6a737d;
    --primary: #1a73e8;
    --red: #d93025;
    --green: #188038;
    --orange: #e8710a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

.layout { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: #1f2733; color: #cfd6df; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar .logo { font-size: 16px; font-weight: bold; color: #fff; padding: 20px 16px; border-bottom: 1px solid #2c3644; }
.sidebar nav { display: flex; flex-direction: column; padding: 8px 0; flex: 1; }
.sidebar nav a { color: #cfd6df; text-decoration: none; padding: 11px 20px; }
.sidebar nav a:hover { background: #2c3644; color: #fff; }
.sidebar nav a.active { background: var(--primary); color: #fff; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid #2c3644; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.sidebar-foot a { color: #8ab4f8; text-decoration: none; }

.main { flex: 1; padding: 20px 24px; min-width: 0; }

.page-head { margin-bottom: 16px; }
.page-head h2 { font-size: 20px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.card-label { color: var(--muted); font-size: 13px; }
.card-value { font-size: 24px; font-weight: bold; margin-top: 6px; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.panel.narrow { max-width: 460px; }
.panel h3 { font-size: 15px; margin-bottom: 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: normal; font-size: 13px; white-space: nowrap; }
tbody tr:hover { background: #f8f9fb; }
.empty { color: var(--muted); text-align: center; padding: 24px; }
.ellip { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops { white-space: nowrap; }
.ops a { color: var(--primary); text-decoration: none; margin-right: 8px; }
.ops form { display: inline; }
.link-danger { background: none; border: none; color: var(--red); cursor: pointer; font-size: 14px; padding: 0; }
.red { color: var(--red); }
.green { color: var(--green); }
.orange { color: var(--orange); }

.st { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.st-pending { background: #fef3e0; color: var(--orange); }
.st-shipped { background: #e8f0fe; color: var(--primary); }
.st-completed { background: #e6f4ea; color: var(--green); }
.st-refunded { background: #fce8e6; color: var(--red); }

.st-select { border: 1px solid var(--border); border-radius: 4px; padding: 3px 4px; font-size: 12px; background: #fff; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }
.flash-ok { background: #e6f4ea; color: var(--green); }
.flash-error { background: #fce8e6; color: var(--red); }

.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-row label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form-row .grow { flex: 1; min-width: 140px; }
.filter-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filter-row label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.filter-row .grow { flex: 1; min-width: 120px; }
.inline-form { display: inline; }

input, select { border: 1px solid var(--border); border-radius: 5px; padding: 7px 10px; font-size: 14px; background: #fff; color: var(--text); }
input:focus, select:focus { outline: 2px solid #aecbfa; border-color: var(--primary); }

.btn { display: inline-block; border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 6px; padding: 8px 16px; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #f3f4f6; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #1765cc; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-group { display: flex; gap: 8px; }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart-bar { width: 70%; max-width: 34px; background: var(--primary); border-radius: 3px 3px 0 0; }
.chart-x { font-size: 11px; color: var(--muted); margin-top: 6px; }

.pager { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.pager a { padding: 5px 10px; border: 1px solid var(--border); border-radius: 5px; text-decoration: none; color: var(--text); }
.pager a.cur { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager span { padding: 5px 2px; color: var(--muted); }

.hint { color: var(--muted); font-size: 13px; }
.import-box summary { cursor: pointer; color: var(--primary); margin-bottom: 8px; }

.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 32px; width: 360px; }
.auth-card h1 { font-size: 20px; margin-bottom: 20px; text-align: center; }
.auth-card label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.auth-card input { width: 100%; margin-top: 4px; }

@media (max-width: 720px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; align-items: center; }
    .sidebar .logo { border-bottom: none; padding: 12px 16px; }
    .sidebar nav { flex-direction: row; overflow-x: auto; }
    .sidebar nav a { padding: 10px 12px; white-space: nowrap; }
    .sidebar-foot { border-top: none; }
}

/* ===== 订单详情页 ===== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }
table.kv { width: 100%; border-collapse: collapse; }
table.kv th { text-align: left; width: 130px; padding: 7px 10px; color: #7f8c8d; font-weight: normal; vertical-align: top; white-space: nowrap; }
table.kv td { padding: 7px 10px; }
