/* =====================================================================
   鲲蓝财税 CMS 管理后台样式
   主色 #071B3A 深蓝 / 辅色 #D5A84D 金色 / 强调 #2BC4B6 青色
   ===================================================================== */
:root {
  --navy: #071B3A;
  --navy-2: #0D2A55;
  --navy-3: #143A6E;
  --gold: #D5A84D;
  --gold-light: #E8C878;
  --teal: #2BC4B6;
  --teal-dark: #12A296;
  --red: #E04545;
  --green: #1F9D55;

  --bg: #F4F6FA;
  --card: #FFFFFF;
  --border: #E4E9F2;
  --text-1: #1A2433;
  --text-2: #5A6678;
  --text-3: #97A0B0;

  --radius: 10px;
  --shadow: 0 2px 10px rgba(7, 27, 58, .06);
  --shadow-lg: 0 12px 40px rgba(7, 27, 58, .18);
  --sidebar-w: 232px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------------- 登录页 ---------------- */
.login-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(43, 196, 182, .14), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(213, 168, 77, .16), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, #08234D 100%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, .98);
  border-radius: 16px;
  padding: 40px 36px 30px;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--gold);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.brand-logo {
  width: 52px; height: 52px; border-radius: 12px;
  background: linear-gradient(135deg, var(--navy), var(--navy-3));
  color: var(--gold);
  font-size: 26px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(7, 27, 58, .3);
  flex: none;
}
.brand-logo.sm { width: 40px; height: 40px; font-size: 20px; border-radius: 10px; }
.login-brand h1 { font-size: 21px; color: var(--navy); font-weight: 800; letter-spacing: .5px; }
.login-brand p { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.login-form label { display: block; font-size: 13px; color: var(--text-2); font-weight: 600; margin-bottom: 16px; }
.login-form input {
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  background: #FBFCFE;
}
.login-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(43, 196, 182, .15); background: #fff; }
.form-error {
  background: rgba(224, 69, 69, .08);
  color: var(--red);
  border: 1px solid rgba(224, 69, 69, .25);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}
.login-tip { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 18px; }
.login-footer { margin-top: 26px; color: rgba(255, 255, 255, .55); font-size: 12px; letter-spacing: 1px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  font-size: 14px;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--navy-3), var(--navy)); color: #fff; }
.btn-primary:hover { box-shadow: 0 4px 14px rgba(7, 27, 58, .35); transform: translateY(-1px); }
.btn-gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--navy); }
.btn-gold:hover { box-shadow: 0 4px 14px rgba(213, 168, 77, .4); transform: translateY(-1px); }
.btn-teal { background: var(--teal); color: #06302d; }
.btn-teal:hover { background: var(--teal-dark); color: #fff; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text-2); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.btn-danger { background: #fff; border-color: rgba(224, 69, 69, .4); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.25); color: rgba(255,255,255,.8); }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 6px; }
.btn-block { width: 100%; }

/* ---------------- 主框架布局 ---------------- */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy) 0%, #0A2347 100%);
  color: #C8D4E8;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  transition: transform .25s;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.sidebar-brand-text strong { color: #fff; font-size: 16px; letter-spacing: 1px; }
.sidebar-brand-text span { font-size: 11.5px; color: rgba(255,255,255,.45); }
.sidebar-nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, .72);
  transition: all .15s;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-nav a.active {
  background: linear-gradient(90deg, rgba(213, 168, 77, .22), rgba(213, 168, 77, .06));
  color: var(--gold-light);
  box-shadow: inset 3px 0 0 var(--gold);
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-foot { padding: 16px; border-top: 1px solid rgba(255, 255, 255, .08); }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 62px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h2 { font-size: 17px; color: var(--navy); font-weight: 700; flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 13px; }
.user-dot { color: var(--teal); font-size: 10px; }
.menu-toggle {
  display: none;
  background: none; border: none; font-size: 20px; color: var(--navy);
}
.content { padding: 26px; flex: 1; }

/* ---------------- 看板 ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.c1::before { background: linear-gradient(90deg, var(--navy), var(--navy-3)); }
.stat-card.c2::before { background: linear-gradient(90deg, var(--teal), #6FE3D8); }
.stat-card.c3::before { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.stat-card .stat-label { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.stat-card .stat-num { font-size: 34px; font-weight: 800; color: var(--navy); margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.panel-head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.panel-head h3 { font-size: 15px; color: var(--navy); }
.panel-head a { font-size: 12.5px; color: var(--teal-dark); font-weight: 600; }
.panel-list { list-style: none; }
.panel-list li {
  padding: 12px 20px;
  border-bottom: 1px solid #F0F3F8;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
}
.panel-list li:last-child { border-bottom: none; }
.panel-list .pl-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); }
.panel-list .pl-date { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; flex: none; }

/* ---------------- 工具条 / 筛选 ---------------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar select, .toolbar input[type="text"], .toolbar input[type="search"] {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  outline: none;
  color: var(--text-1);
}
.toolbar select:focus, .toolbar input:focus { border-color: var(--teal); }
.toolbar .spacer { flex: 1; }

/* ---------------- 表格 ---------------- */
.table-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: auto;
}
table.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #EEF1F6;
  font-size: 13.5px;
  vertical-align: middle;
}
.data-table th {
  background: #F8FAFD;
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
}
.data-table tbody tr:hover { background: #FAFBFE; }
.data-table .td-title { font-weight: 600; color: var(--navy); max-width: 320px; }
.data-table .td-title .sub { display: block; font-weight: 400; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.data-table .td-actions { white-space: nowrap; text-align: right; }
.data-table .td-actions .btn { margin-left: 6px; }

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-cat { background: rgba(43, 196, 182, .12); color: var(--teal-dark); }
.tag-cat.gold { background: rgba(213, 168, 77, .16); color: #9A741F; }
.tag-cat.navy { background: rgba(7, 27, 58, .08); color: var(--navy-2); }
.tag-published { background: rgba(31, 157, 85, .12); color: var(--green); }
.tag-draft { background: rgba(151, 160, 176, .16); color: #6B7484; }
.tag-pin { background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: var(--navy); margin-left: 6px; }
.tag-off { background: rgba(224, 69, 69, .12); color: var(--red); }
.tag-on { background: rgba(31, 157, 85, .12); color: var(--green); }

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}
.loading { padding: 40px; text-align: center; color: var(--text-3); }

/* ---------------- 表单（弹窗内 / 页面内通用）---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-field label .req { color: var(--red); margin-left: 2px; }
.form-field input[type="text"],
.form-field input[type="password"],
.form-field input[type="url"],
.form-field input[type="date"],
.form-field input[type="number"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: #FBFCFE;
  color: var(--text-1);
  transition: border-color .15s, box-shadow .15s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(43, 196, 182, .12);
  background: #fff;
}
.form-field textarea { resize: vertical; min-height: 80px; line-height: 1.7; }
.form-field textarea.big { min-height: 220px; }
.form-check {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #FBFCFE;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.form-check input { width: 16px; height: 16px; accent-color: var(--teal); }
.form-actions {
  display: flex; justify-content: flex-end; gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* 密码页卡片 */
.page-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 28px;
  max-width: 520px;
}
.page-card h3 { font-size: 16px; color: var(--navy); margin-bottom: 20px; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(7, 27, 58, .45);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 200;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 720px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; color: var(--navy); }
.modal-close {
  background: none; border: none; font-size: 15px; color: var(--text-3);
  width: 30px; height: 30px; border-radius: 6px;
}
.modal-close:hover { background: var(--bg); color: var(--navy); }
.modal-body { padding: 22px 24px; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  animation: toastIn .2s ease;
}
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }
@keyframes toastIn { from { transform: translate(-50%, -12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .login-card { padding: 30px 22px 24px; }
}
