:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --high: #dc2626;
  --medium: #d97706;
  --low: #16a34a;
  --sidebar: #0f172a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", -apple-system, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.login-card { background: #fff; padding: 40px; border-radius: 16px; width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); text-align: center; }
.login-card h1 { font-size: 20px; margin-bottom: 8px; color: var(--primary-dark); }
.login-card .subtitle { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-card input { width: 100%; padding: 12px; margin-bottom: 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; }
.login-card button { width: 100%; padding: 12px; background: var(--primary); color: #fff;
  border: none; border-radius: 8px; font-size: 15px; cursor: pointer; }
.login-card button:hover { background: var(--primary-dark); }
.login-tip { margin-top: 16px; font-size: 12px; color: var(--muted); }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--sidebar); color: #cbd5e1; display: flex;
  flex-direction: column; position: fixed; height: 100vh; }
.logo { padding: 20px; font-size: 18px; font-weight: bold; color: #fff; border-bottom: 1px solid #1e293b; }
.sidebar nav { flex: 1; padding: 12px 0; }
.sidebar nav a { display: block; padding: 12px 20px; cursor: pointer; font-size: 14px;
  border-left: 3px solid transparent; transition: all .2s; }
.sidebar nav a:hover { background: #1e293b; color: #fff; }
.sidebar nav a.active { background: #1e293b; color: #fff; border-left-color: var(--primary); }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid #1e293b; font-size: 13px;
  display: flex; justify-content: space-between; align-items: center; }
.sidebar-footer button { background: #334155; color: #cbd5e1; border: none; padding: 6px 10px;
  border-radius: 6px; cursor: pointer; font-size: 12px; }
.main { flex: 1; margin-left: 220px; padding: 24px; }

/* 通用卡片 */
.card { background: var(--card); border-radius: 12px; padding: 20px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card h2 { font-size: 16px; margin-bottom: 16px; }
.page-title { font-size: 22px; margin-bottom: 20px; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--card); border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-card .num { font-size: 32px; font-weight: bold; color: var(--primary); }
.stat-card .label { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* 筛选栏 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: flex-end; }
.filter-bar .field { display: flex; flex-direction: column; gap: 4px; }
.filter-bar label { font-size: 12px; color: var(--muted); }
.filter-bar input, .filter-bar select { padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; min-width: 130px; }
.btn { padding: 8px 16px; background: var(--primary); color: #fff; border: none;
  border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn:hover { background: var(--primary-dark); }
.btn-secondary { background: #64748b; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { background: var(--high); }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f8fafc; color: var(--muted); font-weight: 600; }
tr:hover { background: #f8fafc; }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; margin: 1px; }
.tag-high { background: #fee2e2; color: var(--high); }
.tag-medium { background: #fef3c7; color: var(--medium); }
.tag-low { background: #dcfce7; color: var(--low); }
.tag-industry { background: #dbeafe; color: var(--primary-dark); }
.tag-blacklist { background: #f1f5f9; color: var(--muted); text-decoration: line-through; }

/* 详情 */
.detail-row { display: flex; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.detail-row .label { width: 120px; color: var(--muted); flex-shrink: 0; }
.detail-content { white-space: pre-wrap; line-height: 1.7; }

/* 日历 */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-day { background: var(--card); border-radius: 8px; padding: 8px; min-height: 90px;
  font-size: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.cal-day .date { font-weight: bold; margin-bottom: 6px; color: var(--muted); }
.cal-day.today .date { color: var(--primary); }
.cal-event { padding: 3px 6px; border-radius: 4px; margin-bottom: 4px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event.high { background: #fee2e2; color: var(--high); }
.cal-event.medium { background: #fef3c7; color: var(--medium); }
.cal-event.low { background: #dcfce7; color: var(--low); }

/* Toast */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff; padding: 12px 24px; border-radius: 8px;
  font-size: 14px; z-index: 1300; box-shadow: 0 4px 12px rgba(0,0,0,.2); }

/* 表单 */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-group label { display: flex; align-items: center; gap: 4px; font-size: 13px;
  background: #f1f5f9; padding: 6px 10px; border-radius: 6px; cursor: pointer; }

/* 状态 */
.status-badge { padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.status-success { background: #dcfce7; color: var(--low); }
.status-error { background: #fee2e2; color: var(--high); }
.status-running { background: #dbeafe; color: var(--primary); }
.status-idle { background: #f1f5f9; color: var(--muted); }

/* 分页 */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.pagination button { padding: 6px 12px; border: 1px solid var(--border); background: #fff;
  border-radius: 6px; cursor: pointer; }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 高亮 */
mark { background: #fef08a; padding: 0 2px; border-radius: 2px; }

/* 模态框 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex;
  align-items: center; justify-content: center; z-index: 1200; }
.modal { background: #fff; border-radius: 12px; width: 720px; max-width: 92vw;
  max-height: 88vh; display: flex; flex-direction: column; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 16px; }
.modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; align-items: center; }
