* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; font-size: 14px; background: #fffbf7; color: #2b1a10; }
.hidden { display: none !important; }
.sub { color: #a08b7c; font-size: 13px; }
.error { color: #d83931; min-height: 20px; margin: 6px 0; }
.mono { font-family: Consolas, monospace; }
button { font: inherit; border: 1px solid #ead8c8; background: #fff; border-radius: 6px; padding: 5px 14px; cursor: pointer; }
button:hover { border-color: #ff6a2a; color: #ff6a2a; }
button.primary { background: #ff6a2a; border-color: #ff6a2a; color: #fff; }
button.primary:hover { background: #e8551a; color: #fff; }
button.small { padding: 3px 10px; font-size: 13px; }
button.danger { color: #d83931; }
button.full { width: 100%; margin-top: 8px; }
input, select { font: inherit; border: 1px solid #ead8c8; border-radius: 6px; padding: 5px 8px; }
input:focus, select:focus { outline: none; border-color: #ff6a2a; }
label { display: block; margin-bottom: 12px; color: #6b5546; }
label > input, label > select { display: block; width: 100%; margin-top: 4px; color: #2b1a10; }
label.inline { display: flex; align-items: center; gap: 6px; }
label.inline > input { width: auto; display: inline; margin: 0; }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.card { background: #fff; border-radius: 10px; padding: 24px 28px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.narrow { width: min(380px, 92vw); }
.card h2 { margin: 0 0 4px; font-size: 20px; }
header { display: flex; align-items: center; gap: 20px; background: #fff; padding: 0 20px; height: 54px; border-bottom: 1px solid #f1e2d4; flex-wrap: wrap; }
.brand { font-weight: bold; font-size: 16px; }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav button { border: 0; padding: 7px 14px; }
nav button.active { background: #ffebdd; color: #ff6a2a; font-weight: bold; }
.me { color: #6b5546; }
main { padding: 16px 20px 40px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
#period-bar { justify-content: flex-start; }
#period-bar label { margin: 0; display: flex; align-items: center; gap: 6px; }
#period-bar input { width: auto; display: inline; margin: 0; }
.tab { display: none; }
.tab.active { display: block; }
table.grid { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.grid th { background: #fff3e9; text-align: left; font-weight: normal; color: #6b5546; padding: 9px 10px; font-size: 13px; white-space: nowrap; }
.grid td { padding: 9px 10px; border-top: 1px solid #f6ece2; vertical-align: middle; }
.grid tr.dim td { opacity: .5; }
.grid .empty { text-align: center; color: #a08b7c; padding: 30px; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.badge.green { background: #e3f7e8; color: #1a7f37; }
.badge.blue { background: #ffebdd; color: #ff6a2a; }
.badge.gray { background: #f6ece2; color: #6b5546; }
.badge.red { background: #fde7e6; color: #d83931; }
.badge.orange { background: #fff1e0; color: #c25c00; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card .actions { justify-content: flex-end; margin-top: 12px; }
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 10; }
.modal { width: min(460px, 92vw); max-height: 90vh; overflow: auto; }
.modal h3 { margin: 0 0 16px; }
.code-big { font-family: Consolas, monospace; font-size: 26px; letter-spacing: 3px; text-align: center; padding: 14px; background: #fff3e9; border-radius: 8px; user-select: all; }
#toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: rgba(43,26,16,.92); color: #fff; padding: 8px 18px; border-radius: 6px; z-index: 20; }

/* 告警 */
.count { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: #ff7f3f; color: #fff; font-size: 12px; line-height: 18px; text-align: center; }
.count.severe { background: #d83931; }
.alert-dot { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: #d83931; vertical-align: middle; }
.actions button { white-space: nowrap; }

/* 推广员权限 */
.perm-box { border: 1px solid #f1e2d4; border-radius: 8px; padding: 8px 12px; margin: 6px 0 10px; background: #fffaf5; }
.perm-group { margin-top: 6px; }
.perm-group b { display: block; font-size: 13px; color: #6b5546; margin-bottom: 2px; }
.perm-group label.inline { display: block; margin: 2px 0; font-weight: normal; }

/* 删除账号 */
.danger-zone { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #f0c0bc; }
button.danger { color: #d83931; border-color: #f0c0bc; }

/* 七狗远控主题 */
.brand { display: flex; align-items: center; gap: 8px; }
.brand-logo { width: 26px; height: 26px; border-radius: 7px; display: block; }
.login-logo { width: 56px; height: 56px; border-radius: 14px; display: block; margin-bottom: 12px; box-shadow: 0 6px 16px -6px rgba(255,106,42,.5); }
button.primary { background: linear-gradient(135deg, #ff9a3c, #ff6a2a); border-color: #ff7a30; box-shadow: 0 2px 8px -3px rgba(255,106,42,.6); }
button.primary:hover { background: linear-gradient(135deg, #ff8a2c, #e8551a); }
header { border-bottom-color: #f1e2d4; box-shadow: 0 1px 0 #fff3e9; }
