/* 管理后台（PC） */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --green: #07C160; --green-dark: #06AD56;
  --bg: #F4F6F8; --card: #fff; --line: #EBEDF0;
  --text: #1A1D21; --text-2: #5C6470; --text-3: #98A0AA;
  --red: #FA5151; --orange: #FF8A00; --blue: #3B7CFF; --purple: #7B61FF;
  --sidebar: #101B14;
}
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

.layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar { width: 216px; background: var(--sidebar); color: #fff; position: fixed; top: 0; bottom: 0; left: 0; display: flex; flex-direction: column; }
.sidebar .logo { padding: 20px 20px 16px; font-size: 17px; font-weight: 800; letter-spacing: .5px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 9px; }
.sidebar .logo .dot { width: 26px; height: 26px; border-radius: 8px; background: var(--green); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.sidebar nav { padding: 12px 10px; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 9px; font-size: 14px; color: rgba(255,255,255,.72); margin-bottom: 2px; transition: all .15s; }
.sidebar nav a .ico { font-size: 16px; width: 20px; text-align: center; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.on { background: var(--green); color: #fff; font-weight: 600; }
.sidebar .foot { padding: 14px 18px; font-size: 11px; color: rgba(255,255,255,.4); border-top: 1px solid rgba(255,255,255,.08); line-height: 1.7; }

/* 主区 */
.main { flex: 1; margin-left: 216px; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 0 26px; height: 58px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.topbar .title { font-size: 16px; font-weight: 700; }
.topbar .right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-2); }
.topbar .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.topbar .logout { color: var(--text-3); cursor: pointer; }
.topbar .logout:hover { color: var(--red); }

.content { padding: 22px 26px 40px; flex: 1; }

/* 统计卡 */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--card); border-radius: 12px; padding: 17px 18px; border: 1px solid var(--line); position: relative; overflow: hidden; }
.stat-card .l { font-size: 12px; color: var(--text-3); }
.stat-card .v { font-size: 25px; font-weight: 800; margin-top: 7px; letter-spacing: .2px; }
.stat-card .v .u { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 2px; }
.stat-card .s { font-size: 11px; color: var(--text-3); margin-top: 7px; }
.stat-card .bar-ico { position: absolute; right: 14px; top: 16px; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; opacity: .9; }
.bg-green { background: #E8F8EF; color: var(--green); }
.bg-blue { background: #E9F1FF; color: var(--blue); }
.bg-orange { background: #FFF3E2; color: var(--orange); }
.bg-purple { background: #F1EDFF; color: var(--purple); }

/* 卡片/表格 */
.card { background: var(--card); border-radius: 12px; border: 1px solid var(--line); margin-bottom: 18px; }
.card .c-head { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.card .c-head .t { font-size: 15px; font-weight: 700; }
.card .c-head .sub { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 8px; }
.card .c-body { padding: 16px 18px; }

table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
.tb th { text-align: left; padding: 11px 14px; background: #FAFBFC; color: var(--text-2); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tb td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tb tr:last-child td { border-bottom: none; }
.tb tr:hover td { background: #FAFBFC; }
.tb .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.tb .muted { color: var(--text-3); }
.tb .wrap { white-space: normal; }

.btn { border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 600; background: var(--green); color: #fff; }
.btn:hover { background: var(--green-dark); }
.btn.ghost { background: #fff; color: var(--green); border: 1px solid var(--green); }
.btn.ghost:hover { background: #F0FBF5; }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #FFC9C9; }
.btn.danger:hover { background: #FFF3F3; }
.btn.sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn.link { background: none; color: var(--blue); padding: 2px 6px; font-size: 12px; }
.btn.link:hover { background: none; text-decoration: underline; }
.btn.link.dg { color: var(--red); }
.btn:disabled { background: #EEE; color: #AAA; border-color: #EEE; cursor: not-allowed; }

.tag { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 5px; padding: 2px 8px; }
.tag-green { background: #E8F8EF; color: #0BA85C; }
.tag-gray { background: #F0F1F3; color: #909399; }
.tag-orange { background: #FFF3E2; color: #E67E00; }
.tag-red { background: #FFECEC; color: var(--red); }
.tag-blue { background: #E9F1FF; color: var(--blue); }

.input, select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 13px; outline: none; background: #fff; color: var(--text); }
.input:focus, select:focus { border-color: var(--green); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(15,20,17,.45); z-index: 100; display: none; }
.mask.show { display: block; }
.modal { position: fixed; left: 50%; top: 46%; transform: translate(-50%,-46%); background: #fff; border-radius: 14px; z-index: 101; width: 520px; max-width: calc(100vw - 40px); max-height: 84vh; overflow: auto; display: none; box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.modal.show { display: block; }
.modal .m-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 700; }
.modal .m-head .x { color: var(--text-3); font-size: 18px; cursor: pointer; border: none; background: none; }
.modal .m-body { padding: 20px; }
.modal .m-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.form-row { display: flex; align-items: center; margin-bottom: 14px; }
.form-row label { width: 96px; font-size: 13px; color: var(--text-2); flex-shrink: 0; }
.form-row .input, .form-row select { flex: 1; }
.form-row .hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.form-row .col { flex: 1; }

/* 趋势图 */
.chart-wrap { padding: 8px 6px 0; }
.chart-wrap svg { width: 100%; height: 260px; display: block; }
.legend { display: flex; gap: 18px; font-size: 12px; color: var(--text-2); padding: 4px 4px 10px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

.empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 40px 0; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 18px; font-size: 12px; color: var(--text-2); }
.progress-line { height: 6px; background: #F0F1F3; border-radius: 3px; overflow: hidden; min-width: 80px; }
.progress-line i { display: block; height: 100%; background: var(--green); border-radius: 3px; }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(150deg, #0E3A24 0%, #101B14 60%, #071009 100%); }
.login-box { width: 380px; background: #fff; border-radius: 16px; padding: 38px 36px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login-box .lg { text-align: center; margin-bottom: 26px; }
.login-box .lg .ic { width: 52px; height: 52px; border-radius: 14px; background: var(--green); color: #fff; font-size: 24px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.login-box .lg h1 { font-size: 19px; margin-top: 12px; }
.login-box .lg p { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.login-box .field { margin-bottom: 16px; }
.login-box label { font-size: 13px; color: var(--text-2); display: block; margin-bottom: 6px; }
.login-box .input { width: 100%; padding: 11px 13px; font-size: 14px; }
.login-box .btn { width: 100%; padding: 12px 0; font-size: 15px; margin-top: 6px; }
.login-box .demo { margin-top: 14px; font-size: 12px; color: var(--text-3); background: #F7F8FA; border-radius: 8px; padding: 9px 12px; text-align: center; }

.toast { position: fixed; left: 50%; top: 40px; transform: translateX(-50%); background: rgba(15,20,17,.85); color: #fff; font-size: 13px; padding: 10px 18px; border-radius: 8px; z-index: 200; display: none; }
.toast.show { display: block; }
