/* ========================================================================
   卉鑫硅业 · 管理控制台样式（简洁、实用、无装饰性大图）
   设计：浅色背景 + 深红主色，信息密度优先
   ======================================================================== */
:root {
  --c-primary: #C4271E;
  --c-primary-dark: #8E1B14;
  --c-ink: #1F2937;
  --c-muted: #64748B;
  --c-bg: #F4F6F9;
  --c-card: #FFFFFF;
  --c-border: #E2E8F0;
  --c-side: #0F172A;
  --c-side-2: #1E293B;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--c-bg);
  color: var(--c-ink);
  font-size: 15px;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }

.console-shell { display: flex; min-height: 100vh; }

/* ============ 侧边栏 ============ */
.console-side {
  width: 240px;
  flex-shrink: 0;
  background: var(--c-side);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.console-side .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.console-side .brand img { height: 34px; border-radius: 6px; }
.console-side .brand span { font-weight: 700; color: #fff; font-size: 0.95rem; }
.console-side nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.console-side nav a {
  padding: 11px 14px; border-radius: 8px; font-size: 0.92rem; color: #cbd5e1;
  transition: background 0.2s, color 0.2s;
}
.console-side nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.console-side nav a.active { background: var(--c-primary); color: #fff; font-weight: 600; }
.side-foot { padding: 14px 12px; border-top: 1px solid rgba(255,255,255,0.08); }

/* ============ 主区域 ============ */
.console-main { flex: 1; padding: 28px clamp(18px, 4vw, 44px); min-width: 0; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 1.5rem; color: var(--c-ink); font-weight: 800; }
.page-head p { color: var(--c-muted); margin-top: 6px; max-width: 760px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; font-size: 0.92rem; font-weight: 600;
  cursor: pointer; border: 1.5px solid transparent; transition: all 0.15s; white-space: nowrap;
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); }
.btn-ghost { background: #fff; color: var(--c-ink); border-color: var(--c-border); }
.btn-ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-danger { background: #fff; color: #DC2626; border-color: #FCA5A5; }
.btn-danger:hover { background: #FEE2E2; }
.btn-small { padding: 6px 12px; font-size: 0.82rem; }
.btn-block { width: 100%; }

/* ============ 卡片 / 面板 ============ */
.card { background: var(--c-card); border: 1px solid var(--c-border); border-radius: 12px; padding: 22px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(15,23,42,0.05); }
.card-title { font-size: 1.05rem; color: var(--c-ink); margin-bottom: 14px; font-weight: 700; }
.panel-note { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 14px 18px; color: #9a3412; font-size: 0.88rem; }
.panel-note code { background: rgba(0,0,0,0.06); padding: 1px 6px; border-radius: 4px; }

/* ============ 系统卡片（控制台主页） ============ */
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.sys-card {
  background: var(--c-card); border: 1px solid var(--c-border); border-radius: 12px;
  padding: 24px; display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.sys-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px -12px rgba(15,23,42,0.25); border-color: var(--c-primary); }
.sys-ico { font-size: 2rem; }
.sys-card h3 { font-size: 1.15rem; color: var(--c-ink); }
.sys-card p { font-size: 0.9rem; color: var(--c-muted); flex: 1; }
.sys-go { font-size: 0.9rem; font-weight: 600; color: var(--c-primary); }

/* ============ 数据表格 ============ */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.data-table th { color: var(--c-muted); font-weight: 600; font-size: 0.82rem; background: #f8fafc; }
.data-table tbody tr:hover { background: #f8fafc; }
.cell-input { width: 100%; min-width: 70px; padding: 7px 9px; border: 1px solid var(--c-border); border-radius: 6px; font-size: 0.9rem; font-family: inherit; }
.cell-input:focus { outline: none; border-color: var(--c-primary); }
.data-table .sort-input { width: 64px; min-width: 64px; text-align: center; }
.card .hint { color: var(--c-muted); font-size: 0.82rem; margin: 2px 0 16px; line-height: 1.6; }
.row-actions { display: flex; gap: 6px; }
.up { color: #DC2626; font-weight: 700; }
.down { color: #16A34A; font-weight: 700; }
.muted { color: var(--c-muted); }

/* ============ 表单 ============ */
.form-col { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 160px; }
label { display: block; font-size: 0.85rem; color: var(--c-ink); margin-bottom: 6px; font-weight: 500; }
input[type=text], input[type=date], input[type=number], input[type=password], input:not([type]), select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--c-border); border-radius: 8px;
  font-size: 0.92rem; font-family: inherit; background: #fff; color: var(--c-ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-primary); }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.form-actions.full { grid-column: 1 / -1; }

/* ============ 提示条 ============ */
.alert { padding: 11px 15px; border-radius: 8px; font-size: 0.9rem; margin-bottom: 16px; }
.alert-error { background: #FEE2E2; color: #991B1B; }
.alert-success { background: #DCFCE7; color: #166534; }
.action-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.filter-bar select { width: auto; min-width: 160px; }

/* ============ 登录页 ============ */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%); padding: 20px; }
.auth-card { background: #fff; border-radius: 14px; padding: 36px 32px; width: 100%; max-width: 380px; box-shadow: 0 20px 50px -20px rgba(0,0,0,0.5); }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-logo img { height: 40px; border-radius: 8px; }
.auth-logo h1 { font-size: 1.25rem; color: var(--c-ink); }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card .btn-primary { margin-top: 6px; }
.auth-tip { font-size: 0.8rem; color: var(--c-muted); margin-top: 14px; text-align: center; }

/* ============ 开关 ============ */
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--c-muted); cursor: pointer; }
.switch input { width: auto; }

/* ============ 响应式 ============ */
@media (max-width: 820px) {
  .console-shell { flex-direction: column; }
  .console-side { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .console-side .brand { border: none; padding: 12px 16px; }
  .console-side nav { flex-direction: row; flex-wrap: wrap; padding: 8px 12px; }
  .side-foot { border: none; padding: 8px 12px; }
  .form-grid { grid-template-columns: 1fr; }
}
