/* ============================================================
   山水外餐饮核算系统 — 企业 VI 风格样式
   主色：宋瓷青 #86b7af  瓷白 #dfede9  涪江翠 #87b9a9
   辅色：荷塘绿 #19513c  雅金 #af884c
   ============================================================ */

:root {
  /* 品牌色 */
  --ssw-lotus-green: #19513c;
  --ssw-celadon: #86b7af;
  --ssw-celadon-light: #9ecac3;
  --ssw-fujiang-jade: #87b9a9;
  --ssw-porcelain: #dfede9;
  --ssw-porcelain-soft: #eef6f4;
  --ssw-gold: #af884c;
  --ssw-gold-light: #c9a06a;

  /* 暗色主题映射 */
  --bg-page: #13211e;
  --bg-card: #1a322d;
  --bg-table: #162b27;
  --bg-header: #1f3f39;
  --bg-section: #234a42;
  --bg-input: #1e3934;
  --bg-input-focus: #264b44;
  --bg-calc: rgba(134, 183, 175, 0.08);

  --text-primary: #e8f3f1;
  --text-secondary: #9dbdb6;
  --text-muted: #5e8a80;
  --accent: var(--ssw-gold);
  --accent-light: var(--ssw-gold-light);
  --positive: var(--ssw-fujiang-jade);
  --negative: #d4866a;
  --border: rgba(134, 183, 175, 0.18);
  --border-light: rgba(134, 183, 175, 0.28);

  --font-serif: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --font-sans: -apple-system, "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.55;
  overflow: hidden;
}

body {
  position: relative;
}

/* 山水纹理背景 */
.landscape-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.landscape-bg svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 45%;
  opacity: 0.7;
}

.landscape-bg::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60%;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(134, 183, 175, 0.08), transparent 70%),
    radial-gradient(circle at 85% 20%, rgba(175, 136, 76, 0.04), transparent 30%);
}

#app {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== 顶部栏 ===== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 64px;
  background: linear-gradient(90deg, var(--bg-card) 0%, #1d3b35 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.logo-text-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.logo-slogan {
  font-family: var(--font-serif);
  font-size: 11px;
  color: var(--ssw-gold-light);
  letter-spacing: 0.12em;
  margin-top: 1px;
  opacity: 0.92;
}

.controls {
  display: flex;
  align-items: center;
  gap: 18px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-group label {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-serif);
  letter-spacing: 0.05em;
}

select {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  min-width: 140px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(175, 136, 76, 0.15);
}

select:hover {
  border-color: var(--ssw-celadon);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #9a743f 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 22px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 2px 8px rgba(175, 136, 76, 0.25);
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(175, 136, 76, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== 统计卡片区 ===== */
.stats-bar {
  display: flex;
  gap: 14px;
  padding: 18px 28px;
  background: rgba(26, 50, 45, 0.65);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.stat-card {
  flex: 1;
  position: relative;
  background: linear-gradient(180deg, rgba(134, 183, 175, 0.12) 0%, rgba(25, 81, 60, 0.12) 100%);
  border-radius: 12px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--ssw-celadon);
  opacity: 0.6;
}

.stat-card.highlight::before {
  background: var(--accent);
  opacity: 1;
}

.stat-card.highlight {
  border-color: rgba(175, 136, 76, 0.35);
  background: linear-gradient(180deg, rgba(175, 136, 76, 0.12) 0%, rgba(25, 81, 60, 0.1) 100%);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-family: var(--font-serif);
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 23px;
  font-weight: 600;
  color: var(--text-primary);
  font-feature-settings: "tnum";
}

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== 表格通用 ===== */
.table-container {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
  position: relative;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

/* 表头 */
thead th {
  background: var(--bg-header);
  color: var(--text-secondary);
  font-weight: 500;
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
  font-size: 12px;
  position: sticky;
  z-index: 20;
  box-shadow: 0 1px 0 var(--border-light);
  font-family: var(--font-serif);
}

thead tr:first-child th {
  top: 0;
  height: 40px;
  z-index: 22;
}

thead tr:last-child th {
  top: 40px;
  height: 40px;
  z-index: 21;
}

thead tr:first-child th[rowspan="2"] {
  height: 80px;
  vertical-align: middle;
}

thead th.group-month,
thead th.group-diff {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
  background: #244a43;
}

thead th.group-next-month {
  font-weight: 600;
  color: var(--accent-light);
  font-size: 13px;
  background: #1d3f39;
  border-left: 2px solid rgba(175, 136, 76, 0.4);
}

.period-readonly-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ssw-gold);
  background: rgba(175, 136, 76, 0.12);
  border: 1px solid rgba(175, 136, 76, 0.35);
  border-radius: 10px;
  vertical-align: middle;
  white-space: nowrap;
}

thead th.next-month-th {
  color: var(--accent-light);
  background: #1d3f39;
}

thead th.next-month-th:first-of-type {
  border-left: 2px solid rgba(175, 136, 76, 0.4);
}

thead th.group-month.next {
  background: #1f3f39;
  color: var(--text-secondary);
}

td {
  padding: 0;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

td.col-code, td.col-name {
  text-align: left;
  padding: 8px 10px;
}

/* 列宽 */
.col-code { width: 70px; min-width: 70px; }
.col-name { width: 200px; min-width: 160px; }
.col-num { width: 110px; min-width: 90px; }
.col-ratio { width: 70px; min-width: 60px; }

/* 行类型 */
tr.section-header td {
  background: var(--bg-section);
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-serif);
}

tr.section-header td.col-code {
  color: var(--accent-light);
}

tr.sub-header td {
  background: rgba(35, 74, 66, 0.5);
  font-weight: 500;
  color: var(--text-primary);
}

tr.sub-header td.col-code {
  color: var(--text-secondary);
}

/* 输入单元格 */
td.input-cell {
  background: var(--bg-input);
}

td.input-cell input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  text-align: right;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: background 0.15s;
}

td.input-cell input:focus {
  background: var(--bg-input-focus);
  box-shadow: inset 0 0 0 2px var(--accent);
}

td.input-cell input::placeholder {
  color: var(--text-muted);
}

/* 计算单元格 */
td.calc-cell {
  background: var(--bg-calc);
  color: var(--text-primary);
  padding: 8px 10px;
  font-feature-settings: "tnum";
}

td.calc-cell.muted {
  color: var(--text-secondary);
}

td.calc-cell.positive { color: var(--positive); }
td.calc-cell.negative { color: var(--negative); }

/* 下月列样式 */
td.next-month-cell {
  border-left: 2px solid rgba(175, 136, 76, 0.2);
}

td.next-month-cell.calc-cell {
  background: rgba(175, 136, 76, 0.04);
  color: var(--accent-light);
}

td.next-month-cell.input-cell {
  background: rgba(175, 136, 76, 0.06);
}

td.next-month-cell.input-cell input {
  color: var(--accent-light);
}

td.next-month-cell.input-cell input:focus {
  background: rgba(175, 136, 76, 0.12);
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* section/sub-header 行中的下月列 */
tr.section-header td.next-month-cell,
tr.sub-header td.next-month-cell {
  background: rgba(175, 136, 76, 0.08);
  color: var(--accent-light);
}

/* 层级缩进：按科目编码 1 / 1.1 / 1.1.1 / 1.1.1.1 对齐 */
td.col-name.indent-1 { padding-left: 24px; }
td.col-name.indent-2 { padding-left: 44px; }
td.col-name.indent-3 { padding-left: 64px; }
td.col-name.indent-4 { padding-left: 84px; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 26px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  z-index: 1000;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 13px;
  font-family: var(--font-serif);
  letter-spacing: 0.03em;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success { border-color: var(--positive); }
.toast.error { border-color: var(--negative); }

/* 未保存指示点 */
.unsaved-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 6px;
  box-shadow: 0 0 6px var(--accent);
}

/* 滚动条 */
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: rgba(134, 183, 175, 0.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(134, 183, 175, 0.4); }

/* ============================================================
   重点经营指标
   ============================================================ */
#keyMetricsContent {
  padding: 22px 28px;
}

.km-block {
  margin-bottom: 34px;
  background: rgba(22, 43, 39, 0.85);
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.km-chart-wrapper {
  height: 280px;
  padding: 18px 22px;
  background: rgba(134, 183, 175, 0.04);
  border-bottom: 1px solid var(--border);
}

.km-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0;
  padding: 14px 18px;
  background: linear-gradient(90deg, var(--bg-section) 0%, rgba(175, 136, 76, 0.12) 100%);
  border-left: 4px solid var(--accent);
  font-family: var(--font-serif);
  letter-spacing: 0.04em;
}

.km-unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 4px;
}

.km-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  background: transparent;
}

.km-table thead th {
  background: var(--bg-header);
  color: var(--text-secondary);
  font-weight: 500;
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.km-table thead th.km-dept-col {
  text-align: left;
  min-width: 100px;
  position: sticky;
  left: 0;
  z-index: 11;
  background: var(--bg-header);
}

.km-table thead th.km-avg,
.km-table thead th.km-total {
  color: var(--accent-light);
  font-weight: 600;
}

.km-table thead th.km-quarter {
  color: var(--ssw-celadon);
  font-weight: 600;
  border-left: 1px solid var(--border);
}

.km-table tbody tr:hover {
  background: rgba(134, 183, 175, 0.08);
}

.km-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
  font-feature-settings: "tnum";
}

.km-table td.km-dept-name {
  text-align: left;
  font-weight: 500;
  color: var(--text-primary);
  position: sticky;
  left: 0;
  background: rgba(22, 43, 39, 0.95);
  z-index: 5;
}

.km-table tbody tr:hover td.km-dept-name {
  background: rgba(134, 183, 175, 0.12);
}

.km-cell.km-empty { color: var(--text-muted); }
.km-cell.km-zero { color: var(--text-muted); }
.km-cell.km-num { color: var(--text-primary); }
.km-cell.km-pct { color: var(--positive); }

.km-cell.km-avg-cell,
.km-cell.km-total-cell {
  color: var(--accent-light);
  font-weight: 600;
  border-left: 1px solid var(--border);
  background: rgba(175, 136, 76, 0.04);
}

.km-cell.km-quarter-cell {
  color: var(--ssw-celadon);
  font-weight: 500;
  border-left: 1px solid var(--border);
  background: rgba(134, 183, 175, 0.05);
}

/* 来源标签 */
.km-source {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.04em;
}

.km-source-auto {
  background: rgba(135, 185, 169, 0.14);
  color: var(--ssw-fujiang-jade);
  border: 1px solid rgba(135, 185, 169, 0.3);
}

.km-source-manual {
  background: rgba(175, 136, 76, 0.14);
  color: var(--ssw-gold-light);
  border: 1px solid rgba(175, 136, 76, 0.3);
}

/* 可编辑单元格 */
.km-cell.km-editable {
  padding: 0;
  background: var(--bg-input);
}

.km-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  text-align: right;
  padding: 9px 8px;
  font-size: 13px;
  font-family: inherit;
  font-feature-settings: "tnum";
  outline: none;
  border-radius: 4px;
  transition: background 0.15s, box-shadow 0.15s;
}

.km-input::placeholder {
  color: var(--text-muted);
  font-size: 12px;
}

.km-input:focus {
  background: var(--bg-input-focus);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.km-input.km-dirty {
  background: rgba(175, 136, 76, 0.14);
  color: var(--accent-light);
}

.km-input.km-empty {
  color: var(--text-muted);
}

/* 表格底部圆角 */
.km-table tbody tr:last-child td { border-bottom: none; }
.km-table tbody tr:last-child td:first-child { border-bottom-left-radius: 14px; }
.km-table tbody tr:last-child td:last-child { border-bottom-right-radius: 14px; }

/* ============================================================
   整体推移表
   ============================================================ */
#pushTableContent {
  padding: 18px 24px;
}

.pt-header {
  margin-bottom: 14px;
}

.pt-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-serif);
  letter-spacing: 0.04em;
}

.pt-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.pt-table-wrapper {
  overflow: auto;
  max-height: calc(100vh - 150px);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-table);
}

.pt-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  white-space: nowrap;
  background: transparent;
}

.pt-table thead th {
  background: var(--bg-header);
  color: var(--text-secondary);
  font-weight: 500;
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  z-index: 10;
}

.pt-table thead tr.pt-thead-row1 th {
  top: 0;
  z-index: 20;
}

.pt-table thead tr.pt-thead-row2 th {
  top: 34px;
  z-index: 19;
  font-size: 11px;
}

.pt-table thead th.pt-col-label {
  text-align: left;
  min-width: 150px;
  position: sticky;
  left: 0;
  z-index: 21;
}

.pt-table thead tr.pt-thead-row1 th.pt-col-label {
  z-index: 22;
}

.pt-table thead th.pt-group-header {
  border-left: 1px solid var(--border);
  color: var(--accent-light);
  font-weight: 600;
}

.pt-table thead th.pt-group-header:first-of-type {
  border-left: none;
}

.pt-table thead th.pt-sub-header {
  min-width: 58px;
  font-size: 10px;
  color: var(--text-secondary);
}

.pt-table tbody td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-feature-settings: "tnum";
}

.pt-table tbody td.pt-col-label {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--bg-table);
  z-index: 5;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 150px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-table tbody tr.pt-section-header td {
  background: var(--bg-section);
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-serif);
}

.pt-table tbody tr.pt-section-header td.pt-col-label {
  background: var(--bg-section);
}

.pt-table tbody tr.pt-subtotal td {
  background: rgba(35, 74, 66, 0.55);
  font-weight: 500;
}

.pt-table tbody tr.pt-subtotal td.pt-col-label {
  background: rgba(35, 74, 66, 0.55);
}

.pt-table tbody tr.pt-calc td {
  background: rgba(134, 183, 175, 0.1);
  font-weight: 600;
}

.pt-table tbody tr.pt-calc td.pt-col-label {
  background: rgba(134, 183, 175, 0.1);
  color: var(--ssw-celadon-light);
}

.pt-table tbody tr:hover td {
  background: rgba(134, 183, 175, 0.08);
}

.pt-table tbody tr:hover td.pt-col-label {
  background: rgba(134, 183, 175, 0.12);
}

.pt-table tbody td.pt-indent {
  padding-left: 22px;
  color: var(--text-secondary);
  font-weight: 400;
}

.pt-cell { color: var(--text-primary); }

.pt-cell.pt-ratio {
  color: var(--text-secondary);
  font-size: 11px;
}

.pt-cell.pt-mp { color: var(--text-primary); }

.pt-cell.pt-actual {
  color: #fff;
  font-weight: 500;
}

.pt-cell.pt-negative { color: var(--negative); }

.pt-cell.pt-change {
  color: var(--text-secondary);
  font-size: 11px;
}

.pt-cell.pt-change.pt-negative { color: var(--negative); }

/* 可编辑单元格 */
.pt-cell.pt-editable {
  padding: 0;
  background: var(--bg-input);
}

.pt-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  text-align: right;
  padding: 6px 6px;
  font-size: 12px;
  font-family: inherit;
  font-feature-settings: "tnum";
  outline: none;
}

.pt-input::placeholder {
  color: var(--text-muted);
  font-size: 11px;
}

.pt-input:focus {
  background: var(--bg-input-focus);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.pt-input.pt-dirty {
  background: rgba(175, 136, 76, 0.14);
  color: var(--accent-light);
}

/* ============================================================
   登录页
   ============================================================ */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 100% 70% at 50% 30%, rgba(25, 81, 60, 0.35), transparent 70%),
    linear-gradient(180deg, #0e1a18 0%, #13211e 50%, #0e1a18 100%);
}

.login-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320" preserveAspectRatio="none"><path fill="rgba(25,81,60,0.12)" d="M0,180 C240,260 480,100 720,180 C960,260 1200,100 1440,160 L1440,320 L0,320 Z"/><path fill="rgba(134,183,175,0.08)" d="M0,240 C320,200 560,280 880,220 C1160,170 1320,260 1440,240 L1440,320 L0,320 Z"/></svg>') no-repeat bottom center / 100% auto;
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 380px;
  background: linear-gradient(180deg, rgba(26, 50, 45, 0.95) 0%, rgba(22, 43, 39, 0.95) 100%);
  border: 1px solid rgba(134, 183, 175, 0.25);
  border-radius: 18px;
  padding: 44px 36px 36px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(175, 136, 76, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  text-align: center;
  backdrop-filter: blur(12px);
}

.login-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
  margin-bottom: 18px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.login-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.login-slogan {
  font-family: var(--font-serif);
  font-size: 12px;
  color: var(--ssw-gold-light);
  letter-spacing: 0.14em;
  margin-bottom: 32px;
  opacity: 0.85;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-field {
  position: relative;
}

.login-input {
  width: 100%;
  background: rgba(30, 57, 52, 0.8);
  border: 1px solid rgba(134, 183, 175, 0.22);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-input::placeholder {
  color: var(--text-muted);
  font-size: 13px;
}

.login-input:focus {
  border-color: var(--accent);
  background: rgba(38, 75, 68, 0.9);
  box-shadow: 0 0 0 3px rgba(175, 136, 76, 0.15);
}

.login-btn {
  margin-top: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #9a743f 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.3em;
  cursor: pointer;
  font-family: var(--font-serif);
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 4px 16px rgba(175, 136, 76, 0.3);
}

.login-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(175, 136, 76, 0.4);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.login-error {
  margin-top: 16px;
  font-size: 13px;
  color: var(--negative);
  min-height: 18px;
  font-family: var(--font-sans);
}

/* ============================================================
   用户信息栏
   ============================================================ */
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.user-role-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.user-role-tag.role-admin {
  background: rgba(175, 136, 76, 0.18);
  color: var(--accent-light);
  border: 1px solid rgba(175, 136, 76, 0.35);
}

.user-role-tag.role-manager {
  background: rgba(135, 185, 169, 0.15);
  color: var(--ssw-fujiang-jade);
  border: 1px solid rgba(135, 185, 169, 0.3);
}

.user-name {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: var(--font-serif);
  white-space: nowrap;
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.btn-logout:hover {
  border-color: var(--negative);
  color: var(--negative);
  background: rgba(212, 134, 106, 0.08);
}

/* ===== 密码管理按钮 ===== */
.btn-pwd-mgmt {
  background: transparent;
  border: 1px solid var(--ssw-gold);
  color: var(--ssw-gold);
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.btn-pwd-mgmt:hover {
  background: rgba(175, 136, 76, 0.12);
}

/* ===== 通用弹窗 ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 30, 22, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: var(--ssw-lotus-green);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  width: 600px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ssw-porcelain);
  font-family: var(--font-serif);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--ssw-gold);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
}

.modal-tip {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 16px;
  line-height: 1.6;
}

/* ===== 密码管理用户列表 ===== */
.pwd-user-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pwd-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(134, 183, 175, 0.06);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  flex-wrap: wrap;
}

.pwd-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}

.pwd-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ssw-porcelain);
}

.pwd-user-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.pwd-user-account {
  font-size: 11px;
  color: var(--accent);
  font-family: 'SFMono-Regular', Consolas, 'Noto Serif SC', monospace;
  letter-spacing: 0.3px;
}

.pwd-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pwd-input {
  width: 180px;
  padding: 6px 10px;
  background: var(--bg-darker);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Consolas', 'Courier New', monospace;
  outline: none;
  transition: border-color 0.2s;
}

.pwd-input:focus {
  border-color: var(--ssw-gold);
}

.btn-gen-pwd {
  background: transparent;
  border: 1px solid var(--ssw-celadon);
  color: var(--ssw-celadon);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-gen-pwd:hover {
  background: rgba(134, 183, 175, 0.12);
}

.btn-save-pwd {
  background: var(--ssw-gold);
  border: none;
  color: #1a1a1a;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-save-pwd:hover {
  filter: brightness(1.1);
}

.btn-save-pwd:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.input-invalid {
  border-color: var(--negative) !important;
  background: rgba(192, 57, 43, 0.08) !important;
}
