/* ============================================================
   望川游戏电竞 · 接派单平台  —— 视觉规范（与 dashuaigou.cn 一致）
   暖白底 + 金铜色（#c08a1e）高级风
   ============================================================ */
:root {
    --bg: #f6f1e8;            /* 暖白背景 */
    --bg-soft: #fbf8f2;
    --card: #ffffff;
    --card-2: #f3ecdd;
    --line: #e6dbc6;
    --text: #3f3428;
    --muted: #94836b;
    --brand: #c08a1e;         /* 金铜色（呼应 LOGO） */
    --brand-dark: #9c6e0f;
    --ok: #1f9e63;
    --warn: #d3870f;
    --danger: #d5493f;
    --radius: 14px;
    --gold-grad: linear-gradient(135deg, #c08a1e, #9c6e0f);
    --shadow: 0 10px 30px rgba(80, 62, 40, .08);
    --shadow-sm: 0 2px 10px rgba(80, 62, 40, .05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px; line-height: 1.6;
}

body {
    min-height: 100vh;
    background-image: radial-gradient(1200px 500px at 50% -10%, rgba(192, 138, 30, .10), transparent 70%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.center { text-align: center; }

/* ---------- 布局 ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 236px; flex-shrink: 0;
    background: var(--card);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    box-shadow: 2px 0 16px rgba(80, 62, 40, .04);
}

.brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 20px; border-bottom: 1px solid var(--line);
}
.brand img { width: 40px; height: 40px; border-radius: 11px; object-fit: cover; }
.brand .brand-text { font-weight: 800; font-size: 16px; letter-spacing: .5px; line-height: 1.1; }
.brand .brand-sub { display: block; font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 4px; padding: 12px 12px; overflow-y: auto; }
.nav-section { font-size: 11px; color: var(--muted); padding: 14px 12px 6px; letter-spacing: 1px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 10px;
    color: var(--muted); font-weight: 600; font-size: 14px;
    border-left: 3px solid transparent;
    transition: .15s;
}
.nav-item i { width: 18px; text-align: center; font-style: normal; }
.nav-item:hover { background: var(--bg-soft); color: var(--text); }
.nav-item.active {
    background: rgba(192, 138, 30, .12);
    color: var(--brand-dark);
    border-left-color: var(--brand);
}
.nav-item.active i { color: var(--brand); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 62px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 26px; border-bottom: 1px solid var(--line);
    background: rgba(251, 248, 242, .9); backdrop-filter: blur(8px);
}
.crumb { font-weight: 800; font-size: 16px; }
.user { display: flex; align-items: center; gap: 12px; }
.user .who { font-weight: 700; }
.role-tag {
    font-size: 12px; padding: 3px 10px; border-radius: 999px;
    background: var(--card-2); color: var(--brand-dark); font-weight: 600;
}
.logout { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.logout:hover { background: var(--card-2); color: var(--danger); }

.content { padding: 26px; max-width: 1180px; width: 100%; }

/* ---------- 卡片 / 统计 ---------- */
.grid { display: grid; gap: 16px; }
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}
.card-title {
    font-size: 15px; font-weight: 700; margin: 0 0 14px;
    display: flex; align-items: center; justify-content: space-between;
    padding-left: 11px; border-left: 3px solid var(--brand);
}
.card-title a { font-size: 13px; font-weight: 600; color: var(--brand); }
.section-title {
    font-size: 17px; font-weight: 800; margin: 28px 0 14px;
    padding-left: 12px; border-left: 4px solid var(--brand);
}
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 27px; font-weight: 800; margin-top: 6px; color: var(--text); letter-spacing: .5px; }
.stat .value.gold { color: var(--brand-dark); }
.stat .value.sm { font-size: 20px; }
.stat .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 700; font-size: 13px; background: var(--bg-soft); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-soft); }
.table .amount { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--brand-dark); }

/* ---------- 徽章 ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.pending { background: rgba(211, 135, 15, .14); color: var(--warn); }
.badge.approved { background: rgba(31, 158, 99, .14); color: var(--ok); }
.badge.rejected { background: rgba(213, 73, 63, .14); color: var(--danger); }
.badge.paid { background: rgba(192, 138, 30, .16); color: var(--brand-dark); }
.badge.info { background: rgba(192, 138, 30, .16); color: var(--brand-dark); }
.badge.warn { background: rgba(211, 135, 15, .14); color: var(--warn); }
.badge.muted { background: var(--card-2); color: var(--muted); }

/* ---------- 表单 ---------- */
.form { max-width: 600px; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.field .hint { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 4px; }
.input, select, textarea {
    width: 100%; background: var(--bg-soft);
    border: 1px solid var(--line); color: var(--text);
    border-radius: 10px; padding: 11px 13px; font-size: 14px; outline: none;
    transition: .15s; font-family: inherit;
}
.input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(192, 138, 30, .15); background: #fff; }
textarea { resize: vertical; min-height: 84px; }
.row { display: flex; gap: 14px; }
.row > * { flex: 1; min-width: 0; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; cursor: pointer; padding: 11px 20px; border-radius: 10px;
    font-size: 14px; font-weight: 700; font-family: inherit;
    background: var(--gold-grad); color: #fff; transition: .15s;
}
.btn:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(192, 138, 30, .28); }
.btn.ghost { background: var(--card-2); color: var(--text); }
.btn.ghost:hover { background: #ece1cb; box-shadow: none; }
.btn.danger { background: rgba(213, 73, 63, .12); color: var(--danger); }
.btn.danger:hover { background: rgba(213, 73, 63, .18); box-shadow: none; }
.btn.ok { background: rgba(31, 158, 99, .12); color: var(--ok); }
.btn.ok:hover { background: rgba(31, 158, 99, .18); box-shadow: none; }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.block { width: 100%; }
.inline-form { display: inline-block; vertical-align: middle; }
.row-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 13px; }
.alert.error { background: rgba(213, 73, 63, .10); color: var(--danger); border: 1px solid rgba(213, 73, 63, .3); }
.alert.ok { background: rgba(31, 158, 99, .10); color: var(--ok); border: 1px solid rgba(31, 158, 99, .3); }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; gap: 6px; }
.tab { padding: 7px 15px; border-radius: 9px; background: var(--card-2); color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.tab.active { background: var(--gold-grad); color: #fff; }

/* ---------- 列表项 / 图片 / 队友 ---------- */
.img-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.img-grid img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.mates { display: flex; gap: 6px; flex-wrap: wrap; }
.mate { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--card-2); color: var(--brand-dark); font-weight: 600; }
.qr { width: 150px; height: 150px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; font-size: 14px; }

/* ---------- 登录 / 注册（独立页） ---------- */
.login-body {
    margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 20px;
    background: radial-gradient(900px 600px at 50% -10%, rgba(192, 138, 30, .14), transparent 60%), var(--bg);
    color: var(--text); font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
.login-card {
    width: min(420px, 94vw);
    background: var(--card); border: 1px solid var(--line);
    border-radius: 20px; padding: 36px 32px;
    box-shadow: 0 24px 60px rgba(80, 62, 40, .16);
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 6px; }
.login-brand img { width: 60px; height: 60px; border-radius: 16px; object-fit: cover; box-shadow: var(--shadow-sm); }
.login-brand .name { font-size: 21px; font-weight: 800; letter-spacing: .5px; }
.login-title { text-align: center; font-size: 13px; color: var(--muted); margin: 4px 0 24px; letter-spacing: 1px; }
.login-err { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 10px; text-align: center; font-weight: 600; }
.login-input {
    width: 100%; background: var(--bg-soft); border: 1px solid var(--line);
    color: var(--text); border-radius: 11px; padding: 13px 14px; font-size: 14px; margin-bottom: 14px; outline: none;
    font-family: inherit; transition: .15s;
}
.login-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(192, 138, 30, .16); background: #fff; }
.login-btn {
    width: 100%; border: none; cursor: pointer; padding: 13px; border-radius: 11px; font-weight: 800;
    background: var(--gold-grad); color: #fff; font-size: 15px; font-family: inherit; transition: .15s;
}
.login-btn:hover { filter: brightness(1.06); box-shadow: 0 8px 22px rgba(192, 138, 30, .3); }
.login-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 18px; }
.login-foot a { color: var(--brand); font-weight: 600; }

/* ---------- 弹窗 ---------- */
.modal-mask {
    position: fixed; inset: 0; background: rgba(63, 52, 40, .4);
    display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.modal {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; width: 100%; max-width: 480px; max-height: 86vh; overflow: auto;
    box-shadow: 0 20px 56px rgba(63, 52, 40, .28);
}
.modal h3 { margin: 0 0 14px; font-size: 16px; }
.hidden { display: none !important; }

/* ---------- 图表（SVG 轻量） ---------- */
.mini-chart { width: 100%; height: auto; display: block; }
.mini-chart .grid { stroke: var(--line); stroke-width: 1; }
.mini-chart .line { fill: none; stroke: var(--brand); stroke-width: 2.5; }
.mini-chart .dot { fill: var(--brand); }
.mini-chart .bar { fill: var(--brand); }
.mini-chart .axis { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.chart-empty { color: var(--muted); font-size: 13px; padding: 30px 0; text-align: center; }
.chart-card .legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.chart-card .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.flow-bar { display: flex; gap: 12px; flex-wrap: wrap; }
.flow-bar .fb { flex: 1; min-width: 120px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.flow-bar .fb .l { color: var(--muted); font-size: 13px; }
.flow-bar .fb .v { font-size: 24px; font-weight: 800; margin-top: 4px; color: var(--brand-dark); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; box-shadow: none; border-right: none; border-bottom: 1px solid var(--line); }
    .brand { border-bottom: none; }
    .nav { flex-direction: row; overflow-x: auto; padding: 8px; }
    .nav-section { display: none; }
    .nav-item { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
    .nav-item.active { border-left: none; border-bottom-color: var(--brand); }
    .content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .row { flex-direction: column; gap: 0; }
}
