* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; color: #303133; background: #f0f2f5; }
a { text-decoration: none; color: inherit; }
.hidden { display: none !important; }

/* ---------- 布局 ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: #1f2d3d; color: #bfcbd9; flex-shrink: 0; display: flex; flex-direction: column; }
.logo { height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 16px; color: #fff; font-size: 16px; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.08); }
.logo-icon { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: #2f6fed; align-items: center; justify-content: center; font-size: 14px; }
#menu { padding: 10px 0; flex: 1; }
.menu-item { display: block; padding: 12px 20px; color: #bfcbd9; cursor: pointer; transition: background .15s, color .15s; }
.menu-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu-item.active { background: #2f6fed; color: #fff; }
.menu-group-title { padding: 12px 20px 6px; font-size: 13px; color: #8a97a8; }
.menu-item.sub { padding-left: 34px; font-size: 13.5px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid #e8eaf0; display: flex; align-items: center; padding: 0 24px; gap: 12px; position: sticky; top: 0; z-index: 10; }
.spacer { flex: 1; }
.admin-name { color: #606266; }
.logout { color: #2f6fed; font-size: 13px; }
.view { padding: 20px 24px; flex: 1; }

/* ---------- 通用组件 ---------- */
.card { background: #fff; border-radius: 8px; padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #dcdfe6; background: #fff; color: #606266; padding: 7px 14px; border-radius: 5px; cursor: pointer; font-size: 13px; transition: all .15s; }
.btn:hover { color: #2f6fed; border-color: #2f6fed; }
.btn.primary { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.btn.primary:hover { background: #2563d8; }
.btn.danger { color: #f56c6c; border-color: #fbc4c4; }
.btn.danger:hover { background: #fef0f0; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea { border: 1px solid #dcdfe6; border-radius: 5px; padding: 8px 10px; font-size: 13px; outline: none; transition: border-color .15s; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: #2f6fed; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid #ebeef5; font-size: 13px; white-space: nowrap; }
th { color: #909399; font-weight: 500; background: #fafbfc; }
tr:hover td { background: #f7f9fc; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 12px; }
.tag.green { background: #f0f9eb; color: #67c23a; }
.tag.orange { background: #fdf6ec; color: #e6a23c; }
.tag.red { background: #fef0f0; color: #f56c6c; }
.tag.blue { background: #ecf5ff; color: #2f6fed; }
.tag.gray { background: #f4f4f5; color: #909399; }

.pagination { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding-top: 14px; font-size: 13px; color: #606266; }
.pagination button { border: 1px solid #dcdfe6; background: #fff; border-radius: 4px; padding: 4px 10px; cursor: pointer; }
.pagination button.active { background: #2f6fed; color: #fff; border-color: #2f6fed; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filter-bar input, .filter-bar select { width: 160px; }

/* 统计卡片 */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { border-radius: 8px; padding: 16px; color: #fff; }
.stat-card .num { font-size: 22px; font-weight: 700; margin-top: 6px; }
.stat-card .label { font-size: 13px; opacity: .9; }
.sc-green { background: linear-gradient(135deg, #67c23a, #5daf34); }
.sc-orange { background: linear-gradient(135deg, #e6a23c, #cf8f2e); }
.sc-red { background: linear-gradient(135deg, #f56c6c, #dd5454); }
.sc-blue { background: linear-gradient(135deg, #2f6fed, #2458c4); }
.sc-purple { background: linear-gradient(135deg, #7b5cf0, #6344d8); }
.sc-cyan { background: linear-gradient(135deg, #36cfc9, #2ab5b0); }

/* 表单弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 10px; width: 560px; max-width: 94vw; max-height: 88vh; display: flex; flex-direction: column; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid #ebeef5; font-size: 15px; font-weight: 600; display: flex; justify-content: space-between; }
.modal-close { cursor: pointer; color: #909399; font-size: 18px; line-height: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.form-row { display: flex; align-items: flex-start; margin-bottom: 14px; }
.form-row label { width: 110px; text-align: right; padding: 8px 12px 0 0; color: #606266; flex-shrink: 0; }
.form-row label.req::before { content: '*'; color: #f56c6c; margin-right: 3px; }
.form-row .ctrl { flex: 1; }
.form-row input, .form-row select, .form-row textarea { width: 100%; }
.form-row textarea { min-height: 90px; font-family: Menlo, Consolas, monospace; font-size: 12px; }
.form-tip { font-size: 12px; color: #909399; margin-top: 4px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid #ebeef5; display: flex; justify-content: flex-end; gap: 10px; }

/* 二维码弹窗 */
.qr-area { text-align: center; padding: 8px 0 4px; }
.qr-loading { color: #909399; padding: 80px 0; }
.qr-tip, .qr-tips2 { font-size: 13px; color: #606266; margin-top: 10px; }
.qr-tips2 { color: #909399; font-size: 12px; }

/* 首页 */
.dash-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.dash-icon-card { background: #fff; border-radius: 8px; min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.dash-icon-card .icon { font-size: 34px; color: #e05454; }
.dash-icon-card .val { font-size: 20px; font-weight: 700; }

/* 登录 */
.login-mask { position: fixed; inset: 0; background: #1f2d3d; display: flex; align-items: center; justify-content: center; z-index: 200; }
.login-box { background: #fff; border-radius: 12px; padding: 36px; width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-title { text-align: center; font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.login-box input { padding: 11px 12px; }
.login-box button { background: #2f6fed; color: #fff; border: none; border-radius: 6px; padding: 11px; font-size: 15px; cursor: pointer; }
.login-err { color: #f56c6c; font-size: 13px; min-height: 18px; text-align: center; }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: #dcdfe6; border-radius: 22px; cursor: pointer; transition: .2s; }
.switch .slider::before { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: .2s; }
.switch input:checked + .slider { background: #2f6fed; }
.switch input:checked + .slider::before { transform: translateX(18px); }

.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: #303133; color: #fff; padding: 10px 20px; border-radius: 6px; font-size: 13px; z-index: 300; opacity: 0; transition: opacity .25s; }
.toast.show { opacity: .95; }
.toast.error { background: #f56c6c; }

.avatar-mini { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #eee; }
.empty-tip { text-align: center; color: #909399; padding: 30px 0; }
