/* ============ 壹学湃管理后台样式 ============ */
:root {
  --primary: #165dff;
  --primary-light: #4080ff;
  --primary-dark: #0e42d2;
  --success: #00b42a;
  --warning: #ff7d00;
  --error: #f53f3f;
  --purple: #722ed1;
  --text-1: #1d2129;
  --text-2: #4e5969;
  --text-3: #86909c;
  --border: #e5e6eb;
  --divider: #f2f3f5;
  --bg: #f5f6f7;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text-1);
  background: var(--bg);
  font-size: 14px;
}

/* ---------- 登录 ---------- */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #165dff 0%, #4080ff 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 20px;
  padding: 40px 32px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.login-logo img { width: 52px; height: 52px; }

.login-logo-text {
  font-size: 30px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
}

.login-desc { color: var(--text-3); font-size: 13px; margin-bottom: 28px; }
.login-tip { color: var(--text-3); font-size: 12px; margin-top: 14px; }

/* ---------- 通用元素 ---------- */
.input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-1);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.12); }
textarea.input { height: auto; padding: 10px 14px; line-height: 1.6; resize: vertical; font-family: inherit; }

.btn {
  height: 40px;
  padding: 0 18px;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:active { transform: scale(0.97); opacity: 0.9; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; }
.btn-ghost { background: var(--divider); color: var(--text-2); }
.btn-danger { background: #fff; color: var(--error); border: 1px solid rgba(245, 63, 63, 0.3); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 15px; }
.btn-block { width: 100%; }
.login-card .btn { margin-top: 14px; height: 44px; }

/* ---------- 布局 ---------- */
.app-view { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 24px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-size: 17px; font-weight: 700; }
.brand-sub { font-size: 11px; color: var(--text-3); }

.nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}
.nav-item:hover { background: var(--divider); }
.nav-item.active { background: rgba(22, 93, 255, 0.1); color: var(--primary); font-weight: 600; }

.main { flex: 1; min-width: 0; padding: 28px 32px; }
.page-title { font-size: 22px; margin-bottom: 20px; }
.section-title { font-size: 16px; margin: 26px 0 14px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- 看板 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.stat-label { font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.stat-value { font-size: 30px; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-value.green { color: var(--success); }
.stat-value.orange { color: var(--warning); }
.stat-value.purple { color: var(--purple); }
.stat-sub { font-size: 12px; color: var(--text-3); margin-top: 8px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 16px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

.trend-chart { display: flex; align-items: flex-end; gap: 12px; height: 160px; padding-top: 10px; }
.trend-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend-bar {
  width: 100%; max-width: 36px;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.4s;
}
.trend-count { font-size: 12px; color: var(--text-2); }
.trend-date { font-size: 11px; color: var(--text-3); }

.ranking .rank-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 0;
  border-bottom: 1px solid var(--divider);
}
.ranking .rank-row:last-child { border-bottom: none; }
.rank-no {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  background: var(--divider); color: var(--text-2);
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.rank-no.top { background: var(--warning); color: #fff; }
.rank-name { flex: 1; }
.rank-count { color: var(--primary); font-weight: 600; font-size: 13px; }
.empty-hint { color: var(--text-3); font-size: 13px; padding: 24px 0; text-align: center; }

/* ---------- 工具栏/表格 ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar-hint { color: var(--text-3); font-size: 13px; flex: 1; }
.search { width: 220px; }

.tabs { display: flex; gap: 4px; background: #fff; padding: 4px; border-radius: 10px; box-shadow: var(--shadow); }
.tab {
  border: none; background: transparent; padding: 8px 16px; border-radius: 8px;
  cursor: pointer; font-size: 13px; color: var(--text-2);
}
.tab.active { background: rgba(22, 93, 255, 0.1); color: var(--primary); font-weight: 600; }

.table-card { padding: 0; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 13px 16px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--divider); }
.table th { background: #fafbfc; color: var(--text-3); font-weight: 500; white-space: nowrap; }
.table tbody tr:hover { background: #fafbff; }
.table td { vertical-align: middle; }
.table .name-cell { font-weight: 600; }
.table .ops { display: flex; gap: 8px; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; background: var(--divider); color: var(--text-2); margin: 1px 3px 1px 0;
}
.badge.aplus { background: #fff3e0; color: var(--warning); }
.badge.a { background: #e8ffea; color: var(--success); }
.badge.bplus { background: #f5e8ff; color: var(--purple); }
.badge.blue { background: rgba(22, 93, 255, 0.1); color: var(--primary); }

/* ---------- 政策 / 建议卡片 ---------- */
.policy-list, .suggestion-list { display: flex; flex-direction: column; gap: 14px; }
.item-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  padding: 18px 20px;
}
.item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.item-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.item-summary { color: var(--text-2); font-size: 13px; margin-bottom: 6px; }
.item-details { color: var(--text-3); font-size: 12px; line-height: 1.8; }
.item-ops { display: flex; gap: 8px; flex-shrink: 0; }
.sugg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.sugg-field { font-size: 12px; }
.sugg-field label { display: block; color: var(--text-3); margin-bottom: 4px; }
.sugg-field p {
  color: var(--text-2); line-height: 1.7;
  background: var(--bg); border-radius: 8px; padding: 10px;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px; width: 640px; max-width: 100%;
  max-height: 86vh; display: flex; flex-direction: column;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--divider);
  font-size: 16px; font-weight: 600;
}
.modal-close { border: none; background: none; font-size: 24px; color: var(--text-3); cursor: pointer; line-height: 1; }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--divider); }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.form-row label .req { color: var(--error); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-section { font-size: 13px; font-weight: 600; color: var(--text-1); margin: 16px 0 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--border); }
.major-row { display: grid; grid-template-columns: 2fr 80px 70px 90px 32px; gap: 8px; margin-bottom: 8px; align-items: center; }
.major-row .input { height: 36px; padding: 0 10px; font-size: 13px; }
.icon-del { border: none; background: none; color: var(--error); cursor: pointer; font-size: 18px; }
.add-line-btn { margin-top: 4px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 40px; left: 50%; transform: translateX(-50%);
  background: rgba(29, 33, 41, 0.92); color: #fff;
  padding: 10px 22px; border-radius: 20px; font-size: 13px; z-index: 200;
  animation: toast-in 0.2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .sidebar { width: 64px; padding: 16px 8px; }
  .brand-meta, .nav-item span:last-child, .sidebar-footer .btn { font-size: 0; }
  .nav-item { justify-content: center; font-size: 18px; }
  .main { padding: 20px 16px; }
  .form-grid, .sugg-grid { grid-template-columns: 1fr; }
  .major-row { grid-template-columns: 1fr 1fr; }
}
