:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-soft: #3b82f6;
  --gradient-primary: linear-gradient(135deg, #2563eb, #4f46e5);
  --gradient-brand: linear-gradient(135deg, #4f46e5, #7c3aed);
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #ffffff;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }

/* ===== 后台布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 30; transition: transform .25s; }
.sidebar-brand { padding: 20px 22px; font-size: 16px; font-weight: 600; color: #fff; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--gradient-brand); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; box-shadow: 0 4px 12px rgba(124, 58, 237, .4); }
.logo svg { width: 58%; height: 58%; }
.sidebar-nav { flex: 1; padding: 14px 0; overflow-y: auto; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 22px; color: var(--sidebar-text); text-decoration: none; font-size: 14px; transition: all .15s; border-left: 3px solid transparent; }
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.sidebar-nav a.active { color: var(--sidebar-active); background: linear-gradient(90deg, rgba(79, 70, 229, .28), rgba(79, 70, 229, .10)); border-left-color: #818cf8; }
.sidebar-nav .icon { width: 20px; text-align: center; font-size: 15px; opacity: .85; }
.sidebar-footer { padding: 16px 22px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.main { flex: 1; margin-left: 230px; padding: 24px 32px 40px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.topbar h1 { font-size: 20px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

/* ===== 卡片 ===== */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: linear-gradient(180deg, #fafbfe, #fff); border-left: 3px solid var(--primary); }
.card-head h2 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* ===== 按钮 ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; transition: all .18s ease; }
.btn:hover { border-color: #cbd5e1; background: #f8fafc; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(15,23,42,.08); }
.btn-primary { background: var(--gradient-primary); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(37, 99, 235, .25); }
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8, #4338ca); border-color: transparent; }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-success { background: linear-gradient(135deg, #16a34a, #059669); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(22, 163, 74, .22); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: #f1f5f9; color: var(--text); transform: none; box-shadow: none; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.input, select.input, textarea.input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; color: var(--text); outline: none; transition: border .15s; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 180px; }
.search-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search-bar .input { width: auto; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; padding: 11px 14px; background: #f8fafc; color: #475569; font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f5f8ff; }
.table .num { font-variant-numeric: tabular-nums; }
.table .mono { font-family: "SF Mono", Consolas, monospace; font-size: 13px; }

/* ===== 徽章 ===== */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; letter-spacing: .2px; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-amber { background: #fef3c7; color: #b45309; }

/* ===== 分页 ===== */
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pagination-bar select.input { width: auto; padding: 6px 10px; font-size: 13px; }
.pagination-bar .input { font-size: 13px; }
.pagination-links { display: flex; gap: 6px; align-items: center; }
.pagination-links a, .pagination-links span { min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px; color: var(--text); text-decoration: none; font-size: 13px; background: #fff; }
.pagination-links a:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; }
.pagination-links .active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.pagination-links .disabled { opacity: .4; pointer-events: none; background: #f8fafc; }

/* ===== 统计卡 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: flex-start; transition: transform .15s, box-shadow .15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 19px; color: #fff; flex-shrink: 0; }
.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-icon.teal { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.stat-icon.amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-card .label { font-size: 12.5px; color: var(--text-muted); margin-bottom: 4px; }
.stat-card .value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; line-height: 1.15; }
.stat-card .value.teal { color: #0d9488; }
.stat-card .value.blue { color: var(--primary); }
.stat-card .value.amber { color: var(--warning); }
.stat-card .value.red { color: var(--danger); }

/* ===== 工具条 ===== */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.toolbar-left, .toolbar-right { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ===== 消息 ===== */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ===== 弹窗 ===== */
.modal-mask { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 100; align-items: flex-start; justify-content: center; padding: 60px 20px; overflow-y: auto; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,.18); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); }

/* ===== 员工端 H5 ===== */
.phone-stage { max-width: 430px; margin: 0 auto; background: #f8fafc; min-height: 100vh; }
.staff-topbar { background: linear-gradient(135deg, #1d4ed8, #7c3aed); color: #fff; padding: 18px 18px 22px; position: relative; overflow: hidden; }
.staff-topbar::after { content: ""; position: absolute; right: -30px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.08); }
.staff-topbar .hello { font-size: 13px; opacity: .85; }
.staff-topbar h2 { font-size: 20px; font-weight: 600; margin-top: 4px; }
.staff-body { padding: 16px 14px 24px; }
.task-card { background: #fff; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.task-card .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.task-card .phone-num { font-size: 17px; font-weight: 600; font-family: "SF Mono", Consolas, monospace; letter-spacing: .5px; }
.task-card .foot { display: flex; gap: 8px; }
.task-card .foot .btn { flex: 1; justify-content: center; }
.status-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.status-chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 12.5px; cursor: pointer; transition: all .15s; color: var(--text); }
.status-chip:hover { border-color: var(--primary); color: var(--primary); }
.status-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.date-tabs { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 4px; }
.date-tab { padding: 8px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--border); font-size: 13px; cursor: pointer; white-space: nowrap; color: var(--text); }
.date-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.bottom-nav { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--border); display: flex; }
.bottom-nav a { flex: 1; text-align: center; padding: 11px 0; font-size: 12px; color: var(--text-muted); text-decoration: none; }
.bottom-nav a.on { color: var(--primary); font-weight: 600; }
.bottom-nav a .bi { display: block; font-size: 17px; margin-bottom: 2px; }
.ach-card { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.ach-num { font-size: 30px; font-weight: 700; }
.ach-list { margin-top: 10px; }
.ach-item { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }

/* ===== 登录页 ===== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1000px 500px at 15% 10%, #1e3a8a 0%, transparent 55%), radial-gradient(900px 500px at 85% 90%, #4c1d95 0%, transparent 55%), #0f172a; padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 36px 34px; width: 100%; max-width: 400px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login-card .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-card .brand .logo { width: 42px; height: 42px; border-radius: 11px; background: var(--gradient-brand); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; box-shadow: 0 6px 16px rgba(124, 58, 237, .4); }
.login-card h1 { font-size: 19px; font-weight: 600; }
.login-card .sub { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.login-lang { position: absolute; top: 20px; right: 20px; display: flex; gap: 6px; }
.login-lang a { color: rgba(255,255,255,.8); text-decoration: none; font-size: 12px; padding: 5px 11px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; }
.login-lang a.on { background: #fff; color: #1e3a8a; }
.login-footer { color: var(--text-muted, #888); font-size: 12px; text-align: center; margin-top: 22px; letter-spacing: .3px; }

/* ===== 语言切换 ===== */
.lang-switch { display: flex; gap: 4px; }
.lang-switch a { padding: 4px 10px; border-radius: 6px; font-size: 12px; color: var(--text-muted); text-decoration: none; border: 1px solid var(--border); }
.lang-switch a.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 其他 ===== */
.checkbox-cell { width: 36px; text-align: center !important; }
.empty-tip { text-align: center; padding: 48px 0; color: var(--text-muted); }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mb-16 { margin-bottom: 16px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-10 { gap: 10px; }
.text-muted { color: var(--text-muted); } .text-sm { font-size: 12.5px; } .text-danger { color: var(--danger); }
.mono { font-family: "SF Mono", Consolas, monospace; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 16px; }
  .menu-toggle { display: inline-flex !important; }
}
.menu-toggle { display: none; }
