* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f4f6fa; color: #1f2533; }
input, select, button, textarea { font-family: inherit; font-size: 14px; }
button { cursor: pointer; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#2b3a67,#4b6cb7); }
.login-card { background: #fff; padding: 36px 32px; border-radius: 14px; width: 320px; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.login-card h1 { font-size: 22px; text-align: center; }
.login-card .sub { text-align: center; color: #888; margin: 6px 0 22px; font-size: 13px; }
.login-card input { width: 100%; padding: 11px 12px; margin-bottom: 12px; border: 1px solid #d8dee9; border-radius: 8px; }
.login-card button { width: 100%; padding: 11px; background: #4b6cb7; color: #fff; border: none; border-radius: 8px; font-size: 15px; }
.login-card .err { color: #e23; font-size: 13px; margin-top: 10px; text-align: center; min-height: 18px; }

/* 布局 */
#app { display: flex; min-height: 100vh; }
#sidebar { width: 200px; background: #1f2533; color: #cdd3e0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
#sidebar .brand { font-size: 20px; font-weight: 700; color: #fff; padding: 20px 18px; border-bottom: 1px solid #2c3445; }
#sidebar nav { flex: 1; padding: 10px 0; overflow-y: auto; }
#sidebar nav a { display: block; padding: 12px 18px; color: #cdd3e0; text-decoration: none; font-size: 14px; border-left: 3px solid transparent; }
#sidebar nav a:hover { background: #2c3445; color: #fff; }
#sidebar nav a.active { background: #2c3445; color: #fff; border-left-color: #4b6cb7; }
.side-foot { padding: 14px 18px; border-top: 1px solid #2c3445; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.side-foot button { background: transparent; color: #9aa3b5; border: 1px solid #3a4356; border-radius: 6px; padding: 5px 10px; }
#main { flex: 1; padding: 26px 30px; overflow-x: auto; }

/* 标题与工具条 */
h2 { font-size: 20px; margin-bottom: 4px; }
.page-sub { color: #888; font-size: 13px; margin-bottom: 18px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar .spacer { flex: 1; }

/* 按钮 */
.btn { background: #4b6cb7; color: #fff; border: none; border-radius: 7px; padding: 8px 14px; font-size: 13px; }
.btn:hover { background: #3f5ca0; }
.btn.green { background: #2e9e6b; }
.btn.red { background: #d9534f; }
.btn.ghost { background: #eef1f6; color: #364; border: 1px solid #d8dee9; }
.btn.sm { padding: 5px 10px; font-size: 12px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eef1f6; font-size: 13px; }
th { background: #f7f9fc; color: #5b6478; font-weight: 600; }
tr:hover td { background: #fafbfe; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; background: #eef1f6; color: #556; }
.tag.main { background: #e6f4ea; color: #2e9e6b; }
.tag.studio { background: #fdeede; color: #d2870b; }
.tag.active { background: #e6f4ea; color: #2e9e6b; }
.tag.idle { background: #eef1f6; color: #666; }
.tag.risk { background: #fdeaea; color: #d9534f; }
.tag.banned { background: #f0e6e6; color: #8a5a5a; }

/* 表单 */
.modal-mask { position: fixed; inset: 0; background: rgba(20,25,40,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 440px; max-width: 92vw; max-height: 88vh; overflow-y: auto; }
.modal h3 { margin-bottom: 16px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 13px; color: #555; margin-bottom: 5px; }
.form-row input, .form-row select, .form-row textarea { width: 100%; padding: 9px 10px; border: 1px solid #d8dee9; border-radius: 7px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.kpi .label { color: #888; font-size: 13px; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.kpi .value.gold { color: #d2870b; }
.kpi .value.rmb { color: #2e9e6b; }
.chart-card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.04); margin-bottom: 18px; }
.chart { width: 100%; height: 340px; }

/* 打卡网格 */
.checkin-grid { overflow-x: auto; }
.checkin-grid table { min-width: 640px; }
.checkin-grid td input[type=number] { width: 90px; padding: 5px; border: 1px solid #d8dee9; border-radius: 6px; }
.checkin-grid td .done { color: #2e9e6b; font-weight: 600; }

/* 财务对账 */
#report table { margin-top: 10px; }
#report .totrow td { background: #f2f6ff; font-size: 13px; }
#report td.pos { color: #2e9e6b; font-weight: 600; }
#report td.neg { color: #d9534f; font-weight: 600; }
#report h3 { margin: 22px 0 8px; font-size: 16px; }
#report h4 { margin: 18px 0 6px; font-size: 14px; color: #555; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1f2533; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 99; }
.toast.show { opacity: 1; }
.muted { color: #999; font-size: 12px; }
.right { text-align: right; }
