:root {
  /* 奶油底色系 */
  --cream-0: #FBF6EC;
  --cream-1: #F6EFE2;
  --cream-2: #EFE6D4;
  --paper: #FFFBF4;

  /* 暖色文字 */
  --ink-1: #3D3528;
  --ink-2: #6B5F4D;
  --ink-3: #A89A82;

  /* 有机主色 */
  --terra: #E07856;
  --terra-d: #C9633F;
  --sage: #8BA888;
  --sage-d: #6F8E6B;
  --ochre: #D4A574;
  --clay: #B58968;
  --berry: #C76B7A;
  --honey: #E8B96A;

  /* 语义色 */
  --success: #6F8E6B;
  --warning: #D4A574;
  --danger: #C76B7A;
  --info: #8BA888;
  --primary: #E07856;
  --primary-light: #E89474;
  --primary-dark: #C9633F;
  --accent: #D4A574;

  /* 柔和阴影 */
  --shadow-sm: 0 2px 8px rgba(125, 100, 70, 0.06);
  --shadow-md: 0 8px 24px rgba(125, 100, 70, 0.08), 0 2px 6px rgba(125, 100, 70, 0.05);
  --shadow-lg: 0 18px 48px rgba(125, 100, 70, 0.12), 0 4px 12px rgba(125, 100, 70, 0.06);
  --shadow-soft: 0 1px 0 rgba(255,255,255,0.6) inset, 0 4px 14px rgba(125, 100, 70, 0.08);

  /* 圆角 */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-pill: 999px;
  --radius: var(--r-lg);
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);

  --font: "Nunito", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "DM Mono", "JetBrains Mono", "Consolas", monospace;
  --text-primary: var(--ink-1);
  --text-secondary: var(--ink-2);
  --text-muted: var(--ink-3);
  --glass-bg: var(--paper);
  --glass-border: var(--cream-2);
  --shadow: var(--shadow-md);
  --border-color: var(--cream-2);
  --bg-dark: var(--cream-0);
  --bg-mid: var(--cream-1);
  --bg-light: var(--paper);
}

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

html, body {
  height: 100%;
  color: var(--ink-1);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(900px 600px at 8% -5%, rgba(224, 120, 86, 0.10), transparent 60%),
    radial-gradient(800px 500px at 95% 8%, rgba(139, 168, 136, 0.12), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(212, 165, 116, 0.10), transparent 60%),
    linear-gradient(180deg, #FBF6EC 0%, #F7F0E3 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(168, 154, 130, 0.3); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(168, 154, 130, 0.5); background-clip: padding-box; border: 2px solid transparent; }

/* 背景装饰：有机光晕 */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  opacity: 0.5;
  animation: float 8s ease-in-out infinite;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--terra), transparent);
  top: 10%;
  left: -100px;
}

.orb-2 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--sage), transparent);
  bottom: 10%;
  right: -100px;
  animation-delay: -4s;
}

.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(168, 154, 130, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 154, 130, 0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: 0;
  pointer-events: none;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

/* 玻璃拟态 → 奶油卡片 */
.glass {
  background: var(--paper);
  border: 1px solid var(--cream-2);
  box-shadow: var(--shadow-md);
  border-radius: var(--r-lg);
}

/* 登录页 */
#login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.login-container {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 20px;
  z-index: 1;
}

.login-card {
  padding: 44px 36px;
  border-radius: var(--r-xl);
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--cream-2);
  box-shadow: var(--shadow-lg);
}

.logo-area {
  margin-bottom: 32px;
}

.logo-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--terra), var(--ochre));
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: white;
  box-shadow: 0 12px 28px rgba(224, 120, 86, 0.3);
  position: relative;
}

.logo-icon::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 18px;
  border: 1.5px solid rgba(255,255,255,0.35);
  pointer-events: none;
}

.logo-icon.small {
  width: 40px;
  height: 40px;
  font-size: 15px;
  border-radius: 13px;
  margin: 0;
  box-shadow: 0 6px 14px rgba(224, 120, 86, 0.25);
}

.logo-icon.small::after {
  inset: 2px;
  border-radius: 10px;
}

.logo-area h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink-1);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.slogan {
  color: var(--ink-2);
  font-size: 15px;
  letter-spacing: 0.5px;
}

.login-form {
  text-align: left;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

.submission-date-text {
  display: block;
  min-height: 20px;
  padding: 12px 0;
  color: var(--ink-1);
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--cream-1);
  border: 1px solid var(--cream-2);
  border-radius: var(--r-md);
  color: var(--ink-1);
  font-size: 14px;
  font-family: var(--font);
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--terra);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(224, 120, 86, 0.10);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--ink-3);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.required {
  color: var(--berry);
}

.hint-text {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-3);
}

/* 小队长管辖小组复选框组 */
.group-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 12px;
  border: 1px solid var(--line, rgba(255,255,255,0.12));
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  max-height: 168px;
  overflow-y: auto;
}
.group-checks .check-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.group-checks .check-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 14px 8px 0;
  cursor: pointer;
  white-space: nowrap;
}
.group-checks .check-option input { width: 16px; height: 16px; accent-color: var(--accent, #4f8cff); }
.group-checks .check-item input { width: 16px; height: 16px; accent-color: var(--accent, #4f8cff); }

/* 按钮 */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 20px;
  border: 1px solid var(--cream-2);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink-1);
  box-shadow: var(--shadow-sm);
  font-family: var(--font);
}

.btn:hover {
  border-color: var(--terra);
  color: var(--terra);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary {
  background: linear-gradient(135deg, var(--terra), var(--terra-d));
  border: none;
  color: #fff;
  box-shadow: 0 8px 18px rgba(224, 120, 86, 0.32);
}

.btn-primary:hover {
  box-shadow: 0 12px 26px rgba(224, 120, 86, 0.42);
  transform: translateY(-2px);
  color: #fff;
}

.btn-ghost {
  background: var(--cream-1);
  color: var(--ink-2);
  border: 1px solid var(--cream-2);
}

.btn-ghost:hover {
  background: var(--paper);
  color: var(--terra);
  border-color: var(--terra);
}

.btn-danger {
  background: rgba(199, 107, 122, 0.10);
  color: var(--berry);
  border: 1px solid rgba(199, 107, 122, 0.25);
}

.btn-danger:hover {
  background: rgba(199, 107, 122, 0.18);
  color: var(--berry);
  border-color: var(--berry);
}

.btn-block {
  width: 100%;
  padding: 14px;
  font-size: 15px;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
}

.btn-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.22) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.btn-primary:hover .btn-glow {
  opacity: 1;
}

.demo-accounts {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed var(--cream-2);
}

.demo-accounts p {
  color: var(--ink-3);
  font-size: 13px;
  margin-bottom: 12px;
}

.account-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tag {
  padding: 6px 12px;
  background: var(--cream-1);
  border: 1px solid var(--cream-2);
  border-radius: var(--r-pill);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

.tag:hover {
  border-color: var(--terra);
  color: var(--terra);
  background: var(--paper);
}

/* 主应用布局 */
#login-page.hidden,
.page.hidden {
  display: none !important;
}

#main-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  height: 68px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 251, 244, 0.72);
  border-bottom: 1px solid var(--cream-2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink-1);
  letter-spacing: 0.2px;
}

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

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-badge {
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  background: rgba(224, 120, 86, 0.13);
  color: var(--terra-d);
}

.header-right .user-info > span:last-child {
  color: var(--ink-1);
  font-weight: 700;
  font-size: 14px;
}

.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 232px;
  min-height: calc(100vh - 68px);
  padding: 20px 14px;
  border-right: 1px solid var(--cream-2);
  background: rgba(246, 239, 226, 0.6);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
}

.nav-item:hover {
  background: rgba(255, 251, 244, 0.7);
  color: var(--ink-1);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(224, 120, 86, 0.14), rgba(212, 165, 116, 0.10));
  color: var(--terra-d);
  border-color: rgba(224, 120, 86, 0.22);
  box-shadow: var(--shadow-sm);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--terra), var(--ochre));
}

.nav-icon {
  font-size: 17px;
  width: 20px;
  text-align: center;
}

.badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: rgba(224, 120, 86, 0.14);
  color: var(--terra-d);
  font-weight: 700;
  font-family: var(--font-mono);
}

.main-content {
  flex: 1;
  padding: 26px 28px 40px;
  overflow-y: auto;
  height: calc(100vh - 68px);
}

.page-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--ink-1);
  letter-spacing: 0.2px;
}

.section-header h2 .accent {
  background: linear-gradient(120deg, var(--terra), var(--ochre));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-desc {
  color: var(--ink-2);
  font-size: 13.5px;
}

.card {
  border-radius: var(--r-xl);
  padding: 24px;
  margin-bottom: 24px;
  background: var(--paper);
  border: 1px solid var(--cream-2);
  box-shadow: var(--shadow-md);
}

/* 仪表盘 */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 22px;
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--cream-2);
  box-shadow: var(--shadow-md);
  transition: transform 0.25s, box-shadow 0.25s;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  opacity: 0.16;
  filter: blur(8px);
}

.stat-card.c-terra::after { background: var(--terra); }
.stat-card.c-sage::after { background: var(--sage); }
.stat-card.c-ochre::after { background: var(--ochre); }
.stat-card.c-clay::after { background: var(--clay); }
.stat-card > * { position: relative; z-index: 1; }

.stat-card .stat-label {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 700;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  margin: 12px 0 6px;
  color: var(--ink-1);
  letter-spacing: 0.3px;
}

.stat-value .unit {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 600;
  margin-left: 4px;
}

.welcome-card h3 {
  margin-bottom: 16px;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink-1);
}

.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 20px 24px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
}

.filter-group input,
.filter-group select {
  min-width: 160px;
  padding: 10px 14px;
  background: var(--cream-1);
  border: 1px solid var(--cream-2);
  border-radius: var(--r-md);
  color: var(--ink-1);
  font-size: 14px;
  font-family: var(--font);
  transition: all 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--terra);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(224, 120, 86, 0.10);
}

/* 表格 */
.table-card {
  padding: 0;
  overflow: visible;
}

.table-scroll {
  overflow-x: auto;
  max-height: 70vh;
  overflow-y: auto;
  border-radius: var(--r-xl);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table th {
  background: var(--cream-1);
  padding: 13px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--ink-3);
  border-bottom: 1px solid var(--cream-2);
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.data-table th:first-child { padding-left: 24px; }
.data-table th:last-child { padding-right: 24px; }

/* 审批中心与提交记录使用固定列宽的紧凑布局，避免常用屏幕横向滚动。 */
#approvals-table, #shared-table { table-layout: fixed; }
#approvals-table th, #shared-table th { text-align: center; }
#approvals-table th, #approvals-table td,
#shared-table th, #shared-table td { padding: 11px 8px; }
#approvals-table th:first-child, #approvals-table td:first-child,
#shared-table th:first-child, #shared-table td:first-child { padding-left: 12px; }
#approvals-table th:last-child, #approvals-table td:last-child,
#shared-table th:last-child, #shared-table td:last-child { padding-right: 12px; }
#approvals-table th:nth-child(1) { width: 3%; }
#approvals-table th:nth-child(2) { width: 12%; }
#approvals-table th:nth-child(3) { width: 13%; }
#approvals-table th:nth-child(4) { width: 25%; }
#approvals-table th:nth-child(5) { width: 7%; }
#approvals-table th:nth-child(6) { width: 15%; }
#approvals-table th:nth-child(7) { width: 12%; }
#approvals-table th:nth-child(8) { width: 13%; }
#shared-table th:nth-child(1) { width: 15%; }
#shared-table th:nth-child(2) { width: 15%; }
#shared-table th:nth-child(3) { width: 25%; }
#shared-table th:nth-child(4) { width: 9%; }
#shared-table th:nth-child(5) { width: 15%; }
#shared-table th:nth-child(6) { width: 11%; }
#shared-table th:nth-child(7) { width: 10%; }
/* 类目从左开始读更自然；状态与时间作为固定信息统一居中。 */
#approvals-table td:nth-child(2), #shared-table td:nth-child(1) { text-align: left; }
#approvals-table td:nth-child(4), #approvals-table td:nth-child(5),
#approvals-table td:nth-child(6), #approvals-table td:nth-child(7),
#shared-table td:nth-child(3), #shared-table td:nth-child(4),
#shared-table td:nth-child(5), #shared-table td:nth-child(6) { text-align: center; }
.table-ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; overflow: hidden; }
.person-primary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.person-sub { color: var(--ink-3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.compact-time { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12px; }
.approval-row-actions { display: inline-flex; justify-content: center; align-items: center; gap: 5px; white-space: nowrap; }
.approval-row-actions .btn { min-width: 0; padding-left: 9px; padding-right: 9px; }

@media (max-width: 1180px) {
  #approvals-table, #shared-table { font-size: 12px; }
  #approvals-table th, #approvals-table td,
  #shared-table th, #shared-table td { padding: 9px 5px; }
  .approval-row-actions { gap: 3px; }
  .approval-row-actions .btn { padding-left: 7px; padding-right: 7px; font-size: 11px; }
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--cream-2);
  color: var(--ink-1);
  white-space: nowrap;
}

.data-table td:first-child { padding-left: 24px; }
.data-table td:last-child { padding-right: 24px; }

.data-table tbody tr {
  transition: background 0.15s;
}

.data-table tbody tr:hover {
  background: rgba(224, 120, 86, 0.04);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(246, 239, 226, 0.4);
}

.data-table tbody tr:nth-child(even):hover {
  background: rgba(224, 120, 86, 0.06);
}

/* 价值观分组表头 */
.data-table .th-category {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  border-bottom: 2px solid;
}

/* 价值观颜色 — 奶油风中降低饱和度 */
.th-cat-快乐工作 { background: rgba(139, 168, 136, 0.14) !important; color: var(--sage-d); border-bottom-color: rgba(139, 168, 136, 0.35); }
.th-cat-专业专注 { background: rgba(181, 137, 104, 0.14) !important; color: var(--clay); border-bottom-color: rgba(181, 137, 104, 0.35); }
.th-cat-简单高效 { background: rgba(224, 120, 86, 0.12) !important; color: var(--terra-d); border-bottom-color: rgba(224, 120, 86, 0.3); }
.th-cat-拥抱变化 { background: rgba(212, 165, 116, 0.14) !important; color: #B08040; border-bottom-color: rgba(212, 165, 116, 0.35); }

/* Tab */
.tab-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--cream-2);
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 9px 18px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--r-pill);
  transition: all 0.2s;
  font-family: var(--font);
}

.tab-btn:hover {
  color: var(--ink-1);
  background: rgba(255, 251, 244, 0.7);
  border-color: var(--cream-2);
}

.tab-btn.active {
  color: var(--terra-d);
  background: linear-gradient(135deg, rgba(224, 120, 86, 0.14), rgba(212, 165, 116, 0.10));
  border-color: rgba(224, 120, 86, 0.22);
  box-shadow: var(--shadow-sm);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* 角色权限隐藏 */
.role-hidden {
  display: none !important;
}

/* 表单卡片 */
.form-card {
  max-width: 800px;
  padding: 28px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.file-upload {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.file-upload input[type="file"] {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  background: var(--cream-1);
  border: 1px solid var(--cream-2);
  border-radius: var(--r-md);
  color: var(--ink-1);
  font-size: 13px;
  font-family: var(--font);
}

.file-url {
  color: var(--sage-d);
  font-size: 12px;
  word-break: break-all;
}

.batch-template {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(224, 120, 86, 0.06);
  border-radius: var(--r-md);
  border: 1px solid var(--cream-2);
}

.batch-template p {
  color: var(--ink-2);
  font-size: 13px;
}

.batch-preview {
  margin-top: 20px;
}

.result-ok { background: rgba(139, 168, 136, 0.08); }
.result-fail { background: rgba(199, 107, 122, 0.08); }
.result-ok td, .result-fail td { border-bottom-color: var(--cream-2); }
.result-reason { color: var(--berry); font-size: 13px; max-width: 220px; word-break: break-word; }

/* 批量上传区域 */
.batch-upload-zone {
  border: 2px dashed var(--cream-2);
  border-radius: var(--r-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--cream-1);
}
.batch-upload-zone:hover, .batch-upload-zone.dragover {
  border-color: var(--terra);
  background: rgba(224, 120, 86, 0.05);
}
.batch-upload-zone .upload-icon {
  font-size: 36px;
  margin-bottom: 12px;
}
.batch-upload-zone p {
  color: var(--ink-2);
  font-size: 14px;
  margin: 0;
}
.batch-upload-zone .upload-hint {
  font-size: 12px;
  margin-top: 6px;
  color: var(--ink-3);
  opacity: 1;
}

/* 审批 */
.approval-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 700;
}

.approval-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-pending { background: rgba(232, 185, 106, 0.13); color: #B08030; }
.status-pending::before { background: var(--honey); }
.status-approved { background: rgba(139, 168, 136, 0.13); color: var(--sage-d); }
.status-approved::before { background: var(--sage); }
.status-rejected { background: rgba(199, 107, 122, 0.13); color: var(--berry); }
.status-rejected::before { background: var(--berry); }

/* 审批链路进度 */
.approval-chain {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
}

.chain-step {
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--cream-1);
  border: 1px solid var(--cream-2);
  color: var(--ink-2);
}

.chain-step.chain-done {
  background: rgba(139, 168, 136, 0.13);
  border-color: rgba(139, 168, 136, 0.3);
  color: var(--sage-d);
}

.chain-step.chain-current {
  background: rgba(224, 120, 86, 0.12);
  border-color: rgba(224, 120, 86, 0.25);
  color: var(--terra-d);
  font-weight: 700;
}

.chain-step.chain-rejected {
  background: rgba(199, 107, 122, 0.12);
  border-color: rgba(199, 107, 122, 0.25);
  color: var(--berry);
}

.chain-step.chain-pending {
  background: var(--cream-1);
  color: var(--ink-3);
}

.chain-arrow {
  color: var(--ink-3);
  font-size: 10px;
}

.approval-chain-detail {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chain-entry {
  padding: 4px 8px;
  background: var(--cream-1);
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-2);
}

.approval-chain-mini {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(224, 120, 86, 0.10);
  font-size: 11px;
  color: var(--terra-d);
  margin-left: 6px;
}

.direct-submission-row {
  background: rgba(224, 120, 86, 0.03);
}

/* 审批中心工具栏 */
.approval-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--cream-1);
  border: 1px solid var(--cream-2);
  border-radius: var(--r-md);
}

.filter-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.approval-id-search {
  position: relative;
  display: flex;
  align-items: center;
}

.approval-id-search-icon {
  position: absolute;
  left: 12px;
  color: var(--ink-3);
  font-size: 19px;
  line-height: 1;
  pointer-events: none;
}

.approval-id-search input {
  width: 210px;
  min-width: 0;
  padding: 8px 12px 8px 34px;
  color: var(--ink-1);
  font: 600 13px var(--font);
  background: var(--paper);
  border: 1px solid var(--cream-2);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.approval-id-search input::placeholder { color: var(--ink-3); font-weight: 500; }
.approval-id-search input:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 4px rgba(224, 120, 86, .10);
}

.filter-icon {
  position: absolute;
  left: 12px;
  color: var(--ink-3);
  pointer-events: none;
  z-index: 1;
}

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--paper);
  color: var(--ink-1);
  border: 1px solid var(--cream-2);
  border-radius: var(--r-md);
  padding: 8px 36px 8px 36px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 180px;
  outline: none;
  font-family: var(--font);
}

.filter-select:hover {
  background: var(--paper);
  border-color: var(--terra);
}

.filter-select:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 4px rgba(224, 120, 86, 0.10);
}

.filter-select option {
  background: var(--paper);
  color: var(--ink-1);
  padding: 8px;
}

.filter-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg);
  pointer-events: none;
  z-index: 1;
}

.batch-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.batch-info-text {
  color: var(--terra-d);
  font-size: 13px;
  font-weight: 700;
  margin-left: 4px;
}

#approve-select-all,
.approve-checkbox {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--terra);
}

/* 弹窗 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(61, 53, 40, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal.active {
  display: flex;
}

.modal-content {
  width: 90%;
  max-width: 560px;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--cream-2);
  box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink-1);
}

.modal-close {
  background: none;
  border: none;
  color: var(--ink-3);
  font-size: 26px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--cream-1);
  color: var(--berry);
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--cream-2);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 附件预览 */
.modal-content.preview {
  max-width: 90vw;
}
.modal-content.import-modal { max-width: min(960px, 94vw); }
.import-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.import-toolbar input, .panel-tools input { min-width: 230px; padding: 9px 12px; border: 1px solid var(--cream-2); border-radius: var(--r-sm); background: var(--cream-1); }
.import-toolbar span { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.import-table-wrap { max-height: 42vh; overflow: auto; overflow-x: scroll; scrollbar-gutter: stable; border: 1px solid var(--cream-2); border-radius: var(--r-sm); }
.import-table-wrap .data-table { min-width: 620px; }
.import-table-wrap th { position: sticky; top: 0; z-index: 1; background: var(--paper); }
.preview-iframe {
  width: 100%;
  height: 70vh;
  border: none;
  border-radius: var(--r-lg);
  background: #fff;
}

/* Office 文档预览容器 */
.office-preview {
  max-height: 70vh;
  overflow: auto;
  background: #fff;
  border-radius: var(--r-lg);
  padding: 24px;
  font-size: 14px;
  line-height: 1.8;
  color: #333;
}
.office-preview h1, .office-preview h2, .office-preview h3 { margin: 16px 0 8px; color: #1a1a1a; }
.office-preview p { margin: 8px 0; }
.office-preview table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.office-preview th, .office-preview td { border: 1px solid #d0d5dd; padding: 8px 12px; text-align: left; font-size: 13px; }
.office-preview th { background: #f5f7fa; font-weight: 600; }
.office-preview img { max-width: 100%; }

/* Spinner */
.spinner {
  width: 36px; height: 36px;
  margin: 0 auto;
  border: 3px solid var(--cream-2);
  border-top-color: var(--terra);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 启动加载层：鉴权结果出来前覆盖全屏，避免刷新闪登录页 */
.boot-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; background: var(--paper);
}
.boot-spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--cream-2);
  border-top-color: var(--terra);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.boot-text { color: var(--ink-2); font-size: 14px; letter-spacing: 1px; }
.boot-screen.hidden { display: none !important; }

/* 用户表全选列 */
.col-check { width: 44px; text-align: center; padding-left: 8px !important; padding-right: 8px !important; }
.user-checkbox { width: 16px; height: 16px; cursor: pointer; accent-color: var(--terra); }

/* 审批详情 */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.detail-item { display: flex; flex-direction: column; gap: 2px; }
.detail-item.full-width { grid-column: 1 / -1; }
.detail-label { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.detail-value { font-size: 14px; color: var(--ink-1); word-break: break-word; }
.detail-value a { color: var(--terra-d); text-decoration: underline; }
.detail-content { background: var(--cream-1); padding: 12px; border-radius: var(--r-md); white-space: pre-wrap; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.detail-note { margin-top: 16px; padding: 12px; background: var(--cream-1); border-radius: var(--r-md); font-size: 13px; color: var(--ink-2); }

/* 审批中心与提交记录共用的详情弹窗：信息密度更高，流程横向完整展示。 */
.modal-content.approval-detail-modal {
  width: min(820px, 94vw);
  max-width: 820px;
}

.approval-detail-modal .modal-header { padding: 18px 24px; }
.approval-detail-modal .modal-body { padding: 20px 24px 22px; max-height: 68vh; }
.approval-detail-modal .modal-footer { padding: 14px 24px; }

.approval-detail-modal .detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
  row-gap: 8px;
}

.approval-detail-modal .detail-item {
  gap: 5px;
  min-width: 0;
  padding: 7px 0;
}

.approval-detail-modal .detail-item.full-width {
  padding-top: 10px;
  border-top: 1px solid var(--cream-2);
}

.approval-detail-modal .detail-label {
  font-size: 12px;
  letter-spacing: 0.3px;
  color: #a99b82;
}

.approval-detail-modal .detail-value {
  font-size: 15px;
  line-height: 1.5;
}

.approval-detail-modal .approval-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
}

.approval-detail-modal .chain-step {
  padding: 6px 10px;
  border-radius: 9px;
  line-height: 1.35;
  white-space: nowrap;
}

.approval-detail-modal .chain-arrow { font-size: 13px; }

.approval-detail-modal .approval-chain-detail { gap: 7px; }
.approval-detail-modal .chain-entry {
  padding: 8px 10px;
  line-height: 1.5;
  border-radius: 8px;
}

.approval-detail-modal .detail-note {
  margin: 12px 0 0;
  padding: 10px 12px;
}

@media (max-width: 600px) {
  .approval-detail-modal .detail-grid { grid-template-columns: 1fr; gap: 6px; }
  .approval-detail-modal .modal-body { padding: 16px; }
  .approval-detail-modal .modal-header, .approval-detail-modal .modal-footer { padding-left: 16px; padding-right: 16px; }
  .approval-detail-modal .chain-step { white-space: normal; }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: var(--r-md);
  background: var(--paper);
  border: 1px solid var(--cream-2);
  box-shadow: var(--shadow-lg);
  color: var(--ink-1);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
  font-weight: 600;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { border-left: 4px solid var(--sage); }
.toast.error { border-left: 4px solid var(--berry); }

/* 加分成功居中弹窗 */
.success-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 53, 40, 0.5);
  backdrop-filter: blur(8px);
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.success-modal {
  background: linear-gradient(135deg, var(--terra-d), var(--terra));
  border: 1px solid var(--terra);
  border-radius: var(--r-xl);
  padding: 44px 52px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(224, 120, 86, 0.35);
  animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 420px;
}

.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #fff;
  margin: 0 auto 24px;
  font-weight: bold;
}

.success-text {
  color: #fff;
  font-size: 17px;
  line-height: 1.8;
  font-weight: 600;
}

@keyframes scaleIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--cream-2);
  border-top-color: var(--terra);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* 管理后台工具栏 */
.admin-toolbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--cream-2);
}

/* 用户头像色板（管理后台表格） */
.user-cell { display: flex; align-items: center; gap: 12px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff; flex-shrink: 0;
  position: relative;
}
.user-avatar::after { content: ""; position: absolute; inset: -1px; border-radius: 13px; border: 1.5px solid rgba(255,255,255,0.4); }
.ua-1 { background: linear-gradient(135deg, var(--terra), var(--ochre)); box-shadow: 0 4px 10px rgba(224, 120, 86, 0.28); }
.ua-2 { background: linear-gradient(135deg, var(--sage), var(--clay)); box-shadow: 0 4px 10px rgba(139, 168, 136, 0.28); }
.ua-3 { background: linear-gradient(135deg, var(--ochre), var(--terra)); box-shadow: 0 4px 10px rgba(212, 165, 116, 0.28); }
.ua-4 { background: linear-gradient(135deg, var(--clay), var(--sage)); box-shadow: 0 4px 10px rgba(181, 137, 104, 0.28); }
.ua-5 { background: linear-gradient(135deg, var(--berry), var(--terra)); box-shadow: 0 4px 10px rgba(199, 107, 122, 0.28); }
.ua-6 { background: linear-gradient(135deg, var(--sage), var(--ochre)); box-shadow: 0 4px 10px rgba(139, 168, 136, 0.28); }
.user-cell .name-line { font-weight: 700; color: var(--ink-1); }
.user-cell .id-line { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }

/* 用户与角色列表采用规整的居中矩阵；勾选框列仍保持独立。 */
#users-table th:not(.col-check),
#users-table td:not(.col-check) {
  text-align: center;
  vertical-align: middle;
}
#users-table .user-cell { justify-content: center; }
#users-table .actions { justify-content: center; }
#users-table .managed-groups-cell {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}

.role-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; font-size: 11.5px; font-weight: 700;
  border-radius: var(--r-pill);
}
.role-pill .pdot { width: 6px; height: 6px; border-radius: 50%; }
.role-admin { color: var(--terra-d); background: rgba(224, 120, 86, 0.13); }
.role-admin .pdot { background: var(--terra); }
.role-mgr { color: var(--sage-d); background: rgba(139, 168, 136, 0.16); }
.role-mgr .pdot { background: var(--sage); }
.role-staff { color: var(--clay); background: rgba(181, 137, 104, 0.14); }
.role-staff .pdot { background: var(--clay); }

/* 响应式 */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group input,
  .filter-group select {
    width: 100%;
  }

  .app-header {
    padding: 0 16px;
  }

  .main-content {
    padding: 16px;
  }

  .tab-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
  }

  .tab-btn {
    white-space: nowrap;
  }
}

/* =========================
   奶油风组件样式（覆盖旧布局）
   ========================= */

/* 有机 blob 装饰 */
.blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob { position: absolute; filter: blur(50px); opacity: 0.5; border-radius: 50%; }
.blob.b1 { width: 380px; height: 380px; top: -120px; left: -80px; background: radial-gradient(circle at 30% 30%, #F2C3A8, #E8A988 60%, transparent 70%); }
.blob.b2 { width: 320px; height: 320px; top: 30%; right: -100px; background: radial-gradient(circle at 50% 50%, #C2D4BE, #A9C4A4 60%, transparent 70%); }
.blob.b3 { width: 300px; height: 300px; bottom: -120px; left: 35%; background: radial-gradient(circle at 50% 50%, #EAD3B0, #DDBF8E 60%, transparent 70%); }

/* 应用外壳布局 */
#main-app {
  min-height: 100vh;
  display: block;
}
/* #main-app has an ID selector later in the stylesheet; keep the application
   hidden during login regardless of that layout rule. */
#main-app.hidden,
#login-page.hidden {
  display: none !important;
}
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 252px 1fr;
  grid-template-rows: 72px 1fr;
  grid-template-areas: "sidebar header" "sidebar main";
  min-height: 100vh;
}

/* 覆盖旧 app-header */
.app-header {
  grid-area: header;
  height: 72px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 251, 244, 0.72);
  border-bottom: 1px solid var(--cream-2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* 面包屑 */
.breadcrumbs { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.breadcrumbs .home-ico { color: var(--terra); display: inline-flex; }
.breadcrumbs .sep { color: var(--ink-3); }
.breadcrumbs .cur { color: var(--ink-1); font-weight: 700; }

/* 顶部工具区 */
.header-tools { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 14px; }

/* 用户芯片 */
.user-chip {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 18px 6px 6px;
  background: var(--paper);
  border: 1px solid var(--cream-2);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all .2s;
}
.user-chip:hover { border-color: var(--terra); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.user-chip .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--terra), var(--ochre));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: 0 4px 10px rgba(224, 120, 86, 0.3);
  flex-shrink: 0;
}
.user-chip .user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip .user-info .name { font-size: 13px; color: var(--ink-1); font-weight: 700; }
.user-chip .user-info .role { font-size: 11px; color: var(--ink-3); }

/* 退出按钮 */
.logout-btn {
  background: transparent; border: 1px solid var(--cream-2);
  color: var(--ink-2);
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .2s;
  font-family: var(--font);
}
.logout-btn:hover { color: var(--berry); border-color: var(--berry); background: rgba(199, 107, 122, 0.06); }

/* 覆盖旧 sidebar */
.app-layout {
  display: contents;
}
.sidebar {
  grid-area: sidebar;
  width: auto;
  min-height: auto;
  padding: 22px 16px;
  border-right: 1px solid var(--cream-2);
  background: rgba(246, 239, 226, 0.6);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

/* Logo 区域 */
.logo { display: flex; align-items: center; gap: 12px; padding: 4px 8px 24px; border-bottom: 1px dashed var(--cream-2); margin-bottom: 16px; }
.logo-mark {
  width: 44px; height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--terra) 0%, var(--ochre) 60%, var(--sage) 120%);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 8px 18px rgba(224, 120, 86, 0.3);
  position: relative;
  flex-shrink: 0;
}
.logo-mark::after { content: ""; position: absolute; inset: 2px; border-radius: 14px; border: 1.5px solid rgba(255,255,255,0.35); }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text .t1 { font-size: 15px; font-weight: 800; color: var(--ink-1); letter-spacing: .3px; }
.logo-text .t2 { font-size: 10px; color: var(--clay); letter-spacing: 1.4px; text-transform: uppercase; font-family: var(--font-mono); }

/* 轻松而清晰的品牌字样：登录页与侧栏使用同一套圆润标题语言。 */
.logo-area h1 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: clamp(27px, 6.6vw, 31px);
  line-height: 1.2;
  letter-spacing: .2px;
  font-weight: 800;
  color: var(--ink-1);
  transform: translateY(30px); /* 累计约下移 0.8cm，仅微调登录标题本身 */
}
.logo-area h1::after,
.logo-text .t1::after {
  content: '';
  display: inline-block;
  width: .32em;
  height: .32em;
  border-radius: 50%;
  background: var(--terra);
  box-shadow: .35em 0 0 -0.08em rgba(224, 120, 86, .58);
  transform: translateY(-.08em);
}
.slogan {
  /* 标题使用 translateY(30px) 下移时，需同步预留布局空间，避免与标语重叠。 */
  margin-top: 39px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .7px;
}
.logo {
  gap: 10px;
  padding: 6px 5px 22px;
}
.logo-mark {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  font-size: 18px;
}
.logo-mark::after { border-radius: 16px; }
.logo-text { min-width: 0; gap: 5px; }
.logo-text .t1 {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .1px;
}
.logo-text .t2 {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

/* 导航分组 */
.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-label { padding: 14px 14px 8px; font-size: 11px; color: var(--ink-3); letter-spacing: 1px; text-transform: uppercase; font-weight: 700; }
.nav-menu { display: flex; flex-direction: column; gap: 4px; }

/* 侧边栏底部 */
.sidebar-footer {
  margin-top: auto; padding: 16px;
  background: var(--paper);
  border: 1px solid var(--cream-2);
  border-radius: var(--r-md);
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
  box-shadow: var(--shadow-sm);
}
.sidebar-footer .row { display: flex; justify-content: space-between; padding: 3px 0; }
.sidebar-footer .ok { color: var(--sage-d); font-weight: 700; }
.sidebar-footer .v { color: var(--clay); }

/* 主内容区覆盖 */
.main-content {
  grid-area: main;
  overflow-y: auto;
  padding: 26px 32px 44px;
  height: calc(100vh - 72px);
}

/* 页面标题 */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-title-wrap { display: flex; flex-direction: column; gap: 7px; }
.page-title { font-size: 26px; font-weight: 800; color: var(--ink-1); letter-spacing: .2px; margin: 0; }
.page-title .accent {
  background: linear-gradient(120deg, var(--terra), var(--ochre));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.page-sub { color: var(--ink-2); font-size: 12.5px; }
.page-sub .dot { color: var(--terra); margin: 0 6px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 兼容旧 section-header（如有遗漏） */
.section-header { margin-bottom: 24px; }
.section-header h2 { font-size: 26px; font-weight: 800; color: var(--ink-1); margin-bottom: 6px; }
.section-desc { color: var(--ink-2); font-size: 12.5px; }

/* 按钮加号 */
.btn .plus { font-size: 17px; line-height: 1; font-weight: 800; }

/* KPI 卡片（覆盖旧 stat-card） */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 24px; }
.kpi {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--cream-2);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform .25s, box-shadow .25s;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi::after {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 130px; height: 130px; border-radius: 50%;
  opacity: 0.18; filter: blur(8px);
}
.kpi.c-terra::after { background: var(--terra); }
.kpi.c-sage::after { background: var(--sage); }
.kpi.c-ochre::after { background: var(--ochre); }
.kpi.c-clay::after { background: var(--clay); }
.kpi > * { position: relative; z-index: 1; }
.kpi-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.kpi-label { font-size: 11.5px; color: var(--ink-3); letter-spacing: .8px; text-transform: uppercase; font-weight: 700; }
.kpi-ico {
  width: 36px; height: 36px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
}
.c-terra .kpi-ico { background: linear-gradient(135deg, var(--terra), var(--terra-d)); box-shadow: 0 6px 14px rgba(224, 120, 86, 0.3); }
.c-sage  .kpi-ico { background: linear-gradient(135deg, var(--sage),  var(--sage-d));  box-shadow: 0 6px 14px rgba(139, 168, 136, 0.3); }
.c-ochre .kpi-ico { background: linear-gradient(135deg, var(--ochre), #C19355);       box-shadow: 0 6px 14px rgba(212, 165, 116, 0.3); }
.c-clay  .kpi-ico { background: linear-gradient(135deg, var(--clay),  #9A7050);       box-shadow: 0 6px 14px rgba(181, 137, 104, 0.3); }
.kpi-value { font-size: 30px; font-weight: 800; color: var(--ink-1); letter-spacing: .3px; }
.kpi-value .unit { font-size: 13px; color: var(--ink-3); font-weight: 600; margin-left: 5px; }

/* 面板组件 */
.panel {
  background: var(--paper);
  border: 1px solid var(--cream-2);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--cream-2);
  flex-wrap: wrap; gap: 12px;
}
.panel-title { display: flex; align-items: center; gap: 11px; }
.panel-title .dot-bar { width: 5px; height: 20px; border-radius: 3px; background: linear-gradient(180deg, var(--terra), var(--ochre)); }
.panel-title h3 { font-size: 16px; font-weight: 800; color: var(--ink-1); margin: 0; }
.panel-title .meta { font-size: 11.5px; color: var(--ink-3); font-family: var(--font-mono); }
.panel-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.admin-tab { border: 1px solid var(--cream-2); background: var(--paper); color: var(--ink-2); border-radius: var(--r-pill); padding: 9px 15px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.admin-tab.active { background: var(--terra); color: #fff; border-color: var(--terra); }
.table-wrap { overflow-x: auto; overflow-y: hidden; scrollbar-gutter: stable; padding-bottom: 8px; }
.table-wrap::-webkit-scrollbar { height: 10px; }
.table-wrap::-webkit-scrollbar-track { background: var(--cream-1); border-radius: 999px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--clay); border-radius: 999px; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--terra); }
.settings-content { padding: 0 20px 20px; }
.settings-branding { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 14px; }
.settings-section { margin-top: 20px; }
.settings-section > strong { display: block; margin-bottom: 10px; color: var(--ink-1); }
.settings-help { margin: 0 0 10px; color: var(--ink-3); font-size: 13px; }
.settings-table-list { display: grid; gap: 10px; }
.settings-table-option { display: grid; grid-template-columns: 20px minmax(150px, .7fr) minmax(260px, 1.4fr) 70px; align-items: center; gap: 8px; }
.settings-table-option input[type="text"], .settings-table-option input[type="url"] { width: 100%; }
.settings-readonly { display: flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 13px; }
.permission-matrix select { min-width: 82px; }
.my-score-card { margin-top: 18px; padding-bottom: 18px; }
.squad-work-card { margin-top: 18px; padding-bottom: 18px; }
.squad-work-content { padding: 0 20px; }
.squad-summary { display: flex; align-items: baseline; gap: 8px; padding: 8px 0 16px; color: var(--ink-3); font-size: 13px; }
.squad-summary strong { font-size: 24px; color: var(--terra); margin-left: 12px; }
.squad-summary strong:first-child { margin-left: 0; }
.squad-members { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.squad-member { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 11px 12px; border: 1px solid var(--cream-2); background: var(--cream-1); border-radius: var(--r-md); }
.squad-member b { color: var(--terra); }
.squad-member button { grid-column: 1 / -1; justify-self: start; }
.score-visual { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 0 20px; align-items: center; }
.my-score-total { text-align: center; border-right: 1px solid var(--line); padding: 14px; }
.my-score-total strong { display: block; font-size: 36px; color: var(--terra); }
.my-score-total span { color: var(--ink-3); font-size: 13px; }
.score-bars { display: grid; gap: 9px; }
.score-bar-row { display: grid; grid-template-columns: 150px 1fr 42px; align-items: center; gap: 8px; font-size: 13px; }
.score-bar-row i { height: 9px; background: var(--cream-2); border-radius: 999px; overflow: hidden; }
.score-bar-row b { display: block; height: 100%; background: linear-gradient(90deg, var(--terra), var(--ochre)); border-radius: inherit; }
.score-bar-row em { font-style: normal; font-weight: 700; color: var(--ink-2); }
@media (max-width: 760px) { .settings-branding, .settings-table-list, .settings-table-option { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .score-visual { grid-template-columns: 1fr; } .my-score-total { border-right: 0; border-bottom: 1px solid var(--line); } .score-bar-row { grid-template-columns: 90px 1fr 32px; } }
@media (max-width: 760px) { .import-toolbar { align-items: stretch; flex-direction: column; } .import-toolbar input, .panel-tools input { min-width: 0; width: 100%; } }

/* 让 table-card 也走 panel 风格 */
.table-card {
  background: var(--paper);
  border: 1px solid var(--cream-2);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  padding: 0;
}
.table-card .table-scroll { border-radius: var(--r-xl); }

/* 部门单元格 */
.dept-cell { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.dept-cell .ico { color: var(--ink-3); }

/* 操作按钮组 */
.actions { display: inline-flex; gap: 7px; }
.act-btn {
  padding: 6px 13px; font-size: 12px; font-weight: 700;
  border-radius: var(--r-pill);
  border: 1px solid var(--cream-2);
  background: var(--cream-1);
  color: var(--ink-2);
  cursor: pointer; transition: all .15s; font-family: var(--font);
}
.act-btn:hover { color: var(--terra); border-color: var(--terra); background: rgba(224, 120, 86, 0.06); }
.act-btn.danger:hover { color: var(--berry); border-color: var(--berry); background: rgba(199, 107, 122, 0.06); }

/* 快速入口卡片 */
.welcome-card { background: var(--paper); }
.quick-actions .btn { border-radius: var(--r-pill); }

/* 响应式（覆盖） */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "header" "main";
  }
  .sidebar { display: none; }
  .app-header { padding: 0 16px; }
  .main-content { padding: 16px; height: auto; }
}
