/* ============================================
 * 医路相伴·愈见安康 · 内容管理后台 - PC Web 样式
 * 经典左侧栏 + 顶部 Header + 内容区布局
 * ============================================ */

:root {
  --primary: #2b6cb0;
  --primary-light: #4299e1;
  --primary-dark: #1a4f8a;
  --primary-bg: #ebf4ff;
  --success: #38a169;
  --warning: #d69e2e;
  --danger: #e53e3e;
  --info: #3182ce;
  --bg: #f7fafc;
  --card-bg: #ffffff;
  --text: #2d3748;
  --text-light: #718096;
  --text-lighter: #a0aec0;
  --border: #e2e8f0;
  --border-light: #edf2f7;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 220px;
  --header-h: 60px;
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px; line-height: 1.6;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* === 登录页 === */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box {
  background: #fff; padding: 40px; border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.20); width: 400px; max-width: 90%;
}
.login-box h1 { text-align: center; font-size: 22px; color: var(--primary-dark); margin-bottom: 6px; }
.login-box .sub { text-align: center; color: var(--text-light); font-size: 13px; margin-bottom: 28px; }
.login-box .demo-box { margin-top: 16px; padding: 12px; background: #f8fafc; border-radius: var(--radius); font-size: 12px; color: var(--text-light); line-height: 1.8; }

/* === 整体框架 === */
.layout { display: flex; min-height: 100vh; }

/* 侧栏 */
.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 16px 0;
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 50; overflow-y: auto;
}
.sidebar-logo {
  padding: 0 20px 16px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-logo .icon { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 16px; }
.sidebar-logo .name { font-weight: 700; color: var(--primary-dark); font-size: 15px; }
.sidebar-logo .name span { display: block; font-size: 11px; font-weight: 400; color: var(--text-light); }

.sidebar-group-title { padding: 16px 20px 4px; font-size: 11px; color: var(--text-lighter); text-transform: uppercase; letter-spacing: 1px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: var(--text);
  font-size: 13.5px; transition: all .2s; border-left: 3px solid transparent;
  cursor: pointer;
}
.nav-item .icon { width: 20px; text-align: center; font-size: 15px; }
.nav-item:hover { background: #f7fafc; color: var(--primary); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

/* 主区 */
.main { flex: 1; margin-left: var(--sidebar-w); }

/* 顶部 header */
.header {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
}
.header-title { font-size: 16px; font-weight: 600; color: var(--text); }
.user-menu { display: flex; align-items: center; gap: 12px; }
.user-menu .avatar { width: 32px; height: 32px; border-radius: 50%; }
.user-menu .info { font-size: 13px; }
.user-menu .info strong { display: block; font-size: 13px; }
.user-menu .info span { font-size: 11px; color: var(--text-light); }
.user-menu .logout-btn { color: var(--danger); cursor: pointer; font-size: 13px; padding: 6px 12px; border-radius: 6px; }
.user-menu .logout-btn:hover { background: #fed7d7; }

.content { padding: 24px; }

/* === 统计卡 === */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: #fff; padding: 20px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px;
}
.stat-card .icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.stat-card .num { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-card .label { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* === 卡片 === */
.card {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* === 工具栏 === */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .left { display: flex; gap: 10px; align-items: center; flex: 1; }
.toolbar .right { display: flex; gap: 10px; }

/* === 表单元素 === */
.input, .select, .textarea {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13.5px; background: #fff; outline: none; transition: border .15s;
  font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary-light); }
.input.search { width: 240px; }
.textarea { width: 100%; min-height: 80px; resize: vertical; }
label.form-label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-light); font-weight: 500; }
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* === 按钮 === */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: 6px;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  background: var(--primary); color: #fff; transition: all .15s;
}
.btn:hover { background: var(--primary-dark); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #2f855a; }
.btn-warning { background: var(--warning); }
.btn-danger { background: var(--danger); }
.btn-info { background: var(--info); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: #f7fafc; }

/* === 表格 === */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
table.data th, table.data td {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-light);
}
table.data th {
  background: #f8fafc; font-weight: 600; font-size: 12px;
  color: var(--text-light); text-transform: uppercase; letter-spacing: .5px;
}
table.data tr:hover td { background: #f8fafc; }
table.data td.actions { white-space: nowrap; }
table.data td.actions .btn { margin-right: 4px; }

/* === 徽标 === */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-success { background: #c6f6d5; color: #22543d; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fed7d7; color: #742a2a; }
.badge-info    { background: #bee3f8; color: #1a365d; }
.badge-primary { background: var(--primary-bg); color: var(--primary-dark); }

/* === 模态弹窗 === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal {
  background: #fff; border-radius: var(--radius-lg);
  width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--text-light); cursor: pointer; line-height: 1; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 10px; }

/* === 分页 === */
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 16px 0 0; }
.pagination .info { font-size: 12px; color: var(--text-light); margin-right: auto; }
.pagination .btn { min-width: 32px; justify-content: center; padding: 6px 10px; }
.pagination .btn.active { background: var(--primary-dark); }

/* === 空状态 === */
.empty { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty .icon { font-size: 48px; opacity: 0.4; margin-bottom: 12px; }

/* === 标签页 === */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { padding: 10px 16px; cursor: pointer; font-size: 13.5px; color: var(--text-light); border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.hidden { display: none !important; }

/* === 详情字段 === */
.detail-row { display: flex; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 13.5px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { width: 120px; color: var(--text-light); flex-shrink: 0; }
.detail-row .v { flex: 1; color: var(--text); }

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
