/* ============================================================
   企业管理系统 V3 · iOS 26 液态玻璃（暖光浅色 · 顶部可折叠目录）
   ============================================================ */

:root {
  --primary: #ff6a3d;
  --primary-dark: #e04b8a;
  --primary-light: #ffe5d3;
  --success: #16a34a;
  --info: #f59e0b;
  --warning: #f59e0b;
  --danger: #e5484d;
  --dark: #7c4a2d;
  --light: #f7ebdb;
  --white: #ffffff;
  --glass: rgba(255, 255, 255, 0.66);
  --glass-strong: rgba(255, 255, 255, 0.84);
  --glass-border: rgba(255, 255, 255, 0.80);
  --border-color: rgba(90, 45, 15, 0.10);
  --text-primary: #3d2418;
  --text-secondary: rgba(61, 36, 24, 0.66);
  --text-muted: rgba(61, 36, 24, 0.46);
  --radius: 14px;
  --grad: linear-gradient(135deg, #ff9d2f 0%, #ff6a3d 48%, #e04b8a 100%);
  --shadow-glass: 0 16px 44px rgba(140, 70, 20, 0.16), 0 2px 8px rgba(140, 70, 20, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

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

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Noto Sans SC", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  background: linear-gradient(180deg, #fdf6ea 0%, #f7e8d2 45%, #f4e0cf 100%);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

::selection { background: rgba(255, 106, 61, 0.25); }

/* ===== 背景极光层 ===== */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.app-bg::before {
  content: "";
  position: absolute;
  width: 56vw; height: 56vw; left: -12vw; top: -16vw; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 178, 66, 0.52), transparent 64%);
  filter: blur(60px);
}
.app-bg::after {
  content: "";
  position: absolute;
  width: 48vw; height: 48vw; right: -10vw; top: -8vw; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 110, 100, 0.45), transparent 64%);
  filter: blur(60px);
}
.app-bg .aurora-c {
  position: absolute;
  width: 46vw; height: 46vw; right: 2vw; bottom: -16vw; border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 89, 150, 0.36), transparent 64%);
  filter: blur(60px);
}
.app-bg .aurora-d {
  position: absolute;
  width: 42vw; height: 42vw; left: 6vw; bottom: -14vw; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 154, 110, 0.44), transparent 64%);
  filter: blur(60px);
}
.app-bg .dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(90, 45, 15, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover { color: var(--primary-dark); }

/* ===== 顶部可折叠目录栏 ===== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 12px 34px rgba(140, 70, 20, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.top-nav-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  min-height: 58px;
}

.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff;
  box-shadow: 0 5px 16px rgba(255, 106, 61, 0.36), inset 0 1.5px 0 rgba(255, 255, 255, 0.6);
}
.brand-mark svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(90, 45, 15, 0.12);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  flex: none;
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.85); color: var(--text-primary); }
.nav-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-toggle .chev { transition: transform 0.25s; }
.top-nav.collapsed .nav-toggle .chev { transform: rotate(-90deg); }

.breadcrumb {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.topbar-right .user-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 0.85rem;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.6), 0 4px 12px rgba(255, 106, 61, 0.3);
}

/* 目录菜单（可折叠区） */
.nav-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 8px 20px 12px;
  border-top: 1px solid rgba(90, 45, 15, 0.07);
}
.top-nav.collapsed .nav-menu {
  display: none;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-group + .nav-group {
  margin-left: 6px;
  padding-left: 12px;
  border-left: 1px solid rgba(90, 45, 15, 0.08);
}
.nav-section {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-right: 4px;
  white-space: nowrap;
}
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.nav-item svg {
  width: 17px; height: 17px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.60);
  color: var(--text-primary);
  text-decoration: none;
}
.nav-item.active {
  background: var(--grad);
  color: #fff;
  font-weight: 600;
  border-color: transparent;
  box-shadow: 0 7px 20px rgba(255, 106, 61, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.nav-item.active svg { stroke: #fff; }

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.content {
  padding: 24px;
  flex: 1;
}

/* ===== 玻璃卡片 ===== */
.card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(165%);
  backdrop-filter: blur(20px) saturate(165%);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--shadow-glass);
  margin-bottom: 20px;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(90, 45, 15, 0.08);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(90, 45, 15, 0.08);
  background: rgba(255, 255, 255, 0.35);
  border-radius: 0 0 18px 18px;
}

.kpi-card,
.stat-card,
.quick-link,
.panel,
.summary-card,
.detail-card,
.info-card,
.filter-card,
.box,
.widget {
  -webkit-backdrop-filter: blur(20px) saturate(165%);
  backdrop-filter: blur(20px) saturate(165%);
  border: 1px solid var(--glass-border);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--grad);
  color: #fff;
  border: none;
  box-shadow: 0 8px 22px rgba(255, 106, 61, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(255, 106, 61, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  color: #fff;
}
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-outline {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(90, 45, 15, 0.12);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.85); color: var(--text-primary); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.form-control {
  display: block;
  width: 100%;
  padding: 9px 13px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(90, 45, 15, 0.12);
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: rgba(255, 106, 61, 0.6);
  box-shadow: 0 0 0 4px rgba(255, 106, 61, 0.14);
  background: rgba(255, 255, 255, 0.92);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control option { background: #fff; color: var(--text-primary); }

/* ===== 表格 ===== */
.table-container { overflow-x: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
table th,
table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(90, 45, 15, 0.07);
  font-size: 0.92rem;
}
table th {
  background: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
table tbody tr { transition: background 0.15s; }
table tbody tr:hover { background: rgba(255, 255, 255, 0.45); }

/* ===== 提示 ===== */
.alert {
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border-color: #b7dfb9; }
.alert-danger { background: #ffebee; color: #c62828; border-color: #f3b9b9; }
.alert-warning { background: #fff4df; color: #b45309; border-color: #f5d9a8; }
.alert-info { background: #fff3e0; color: #9a4d0a; border-color: #f8d8b0; }

/* ===== 徽章 ===== */
.badge {
  display: inline-block;
  padding: 3px 9px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 999px;
  color: var(--text-primary);
  background: rgba(90, 45, 15, 0.08);
}
.badge-primary { background: var(--primary); color: #fff; }
.badge-success { background: var(--success); color: #fff; }
.badge-warning { background: var(--warning); color: #3d2418; }
.badge-danger { background: var(--danger); color: #fff; }
.badge-info { background: var(--info); color: #3d2418; }
.badge-dark { background: var(--dark); color: #fff; }
.badge-light { background: rgba(90, 45, 15, 0.07); color: var(--text-secondary); }
.badge-secondary { background: rgba(90, 45, 15, 0.07); color: var(--text-secondary); }

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 36, 24, 0.32);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(80, 35, 10, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(90, 45, 15, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(90, 45, 15, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  line-height: 1;
}

/* ===== 加载 ===== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(90, 45, 15, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(247, 235, 219, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* ===== 工具类 ===== */
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.85rem; }
.text-muted { color: var(--text-muted) !important; }
.font-bold { font-weight: 700; }
.required { color: var(--danger); margin-left: 2px; }

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.toolbar .form-control { width: auto; min-width: 150px; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  align-items: flex-end;
}
.filter-row .form-group { margin-bottom: 0; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 0;
}
.pagination .btn { min-width: 36px; padding: 6px 10px; }
.pagination .page-info { padding: 0 12px; font-size: 0.85rem; color: var(--text-secondary); }

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 18px;
  border-radius: 14px;
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  animation: slideIn 0.3s ease;
  max-width: 380px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); color: #3d2418; }
.toast-info { background: var(--info); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== 登录页 ===== */
.login-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px;
  width: 90%;
  max-width: 420px;
  box-shadow: var(--shadow-glass);
}
.login-card h2 {
  text-align: center;
  margin-bottom: 10px;
  color: var(--text-primary);
}
.login-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 30px;
  font-size: 0.9rem;
}

.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--text-muted);
}
.placeholder-page .icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.placeholder-page h3 { font-weight: 500; color: var(--text-secondary); }

.icp-footer {
  text-align: center;
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: transparent;
}
.icp-footer a { color: inherit; text-decoration: none; }
.icp-footer a:hover { text-decoration: underline; }

.college-hint { font-size: 0.82rem; margin-top: 5px; min-height: 18px; line-height: 1.5; }
.college-hint.ok { color: #16a34a; }
.college-hint.warn { color: #b45309; }
.college-hint.none { color: var(--text-muted); }
.college-hint.checking { color: var(--text-secondary); }
.college-hint a { color: var(--primary); font-weight: 600; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .nav-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 14px 14px;
    max-height: 60vh;
    overflow-y: auto;
  }
  .nav-group {
    flex-wrap: wrap;
  }
  .nav-group + .nav-group {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid rgba(90, 45, 15, 0.08);
    margin-top: 6px;
    padding-top: 6px;
  }
  .nav-section {
    width: 100%;
    padding: 4px 4px;
  }
  .nav-item {
    flex: 1 1 45%;
  }
}

@media (max-width: 768px) {
  .top-nav-bar { padding: 8px 12px; gap: 8px; }
  .brand-name { display: none; }
  .breadcrumb {
    font-size: 0.9rem;
    flex: 1 1 auto;
    min-width: 0;
  }
  .topbar-right { gap: 6px; }
  .topbar-right .user-info { max-width: 80px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.8rem; }
  .topbar-right .btn-sm { padding: 5px 8px; font-size: 0.72rem; }
  .topbar-avatar { width: 32px; height: 32px; }
  .nav-toggle span { display: none; }

  .content { padding: 14px; }
  .card { margin-bottom: 14px; border-radius: 16px; }
  .card-header { padding: 13px 15px; font-size: 0.95rem; flex-wrap: wrap; gap: 8px; }
  .card-body { padding: 15px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card-footer { padding: 10px 15px; }

  .table-container { margin: 0 -2px; -webkit-overflow-scrolling: touch; }
  table th, table td { padding: 10px; font-size: 0.85rem; }

  .toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .toolbar .form-control, .toolbar .btn { width: 100%; min-width: 0; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-row .form-control, .filter-row .btn { width: 100%; }

  .form-grid, .form-row, .form2col { grid-template-columns: 1fr !important; gap: 8px !important; }
  .sub-form-row { grid-template-columns: 1fr !important; }

  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .stats-bar { display: grid !important; grid-template-columns: repeat(2, 1fr) !important; }
  .stat-card { min-width: 0 !important; width: 100%; padding: 12px 10px; }
  .stat-num { font-size: 20px; }

  .btn { min-height: 40px; }
  .btn-sm { min-height: 32px; }

  .modal-overlay { align-items: flex-end; }
  .modal { width: 100%; max-width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 10px 16px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal-footer .btn { flex: 1 1 auto; margin: 2px; }

  .toast-container { top: 12px; right: 12px; left: 12px; align-items: stretch; }
  .toast { max-width: 100%; text-align: center; font-size: 0.88rem; }
  .pagination { flex-wrap: wrap; gap: 3px; }
}

/* ===== 字体清晰度（用户重点） ===== */
.card-header, .page-header h2, .panel-title { font-weight: 700; color: var(--text-primary); }
.table { font-size: 0.95rem; color: var(--text-primary); }
.table th { font-weight: 600; color: var(--text-primary); }
.form-control, .btn, select, textarea, input { font-size: 0.95rem; }
