/**
 * styles.css — 浅色 SaaS 主题（§67）
 *
 * 约定：
 * - 主色：商务蓝 #2f6fed（hover #2458c8）/ 青 #0891b2；状态色：正常绿 / 预警橙红 / 请假灰
 * - 布局：左侧固定 220px 导航 + 右侧内容；≤760px 导航转顶部横条、卡片单列
 * - 通用类供各视图复用：.card .btn .btn-primary .btn-danger .modal-mask .modal
 *   .toast .badge .table .form-input 等
 */

:root {
  --primary: #1d5f8f;
  --primary-dark: #16486d;
  --primary-soft: rgba(29, 95, 143, 0.09);
  --cyan: #167c86;
  --bg: #f3f6f8;
  --card-bg: #ffffff;
  --text: #172b3a;
  --text-muted: #647482;
  --border: #dce4e9;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --leave: #9ca3af;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(23, 43, 58, 0.04), 0 5px 16px rgba(23, 43, 58, 0.05);
  --sidebar-width: 232px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #f6f8fa 0%, var(--bg) 52%, #eef3f5 100%);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(243, 246, 248, 0.96);
  opacity: 1;
  transition: opacity 0.24s ease;
}

.app-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.default-loader {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(29, 95, 143, 0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: default-loader-spin 0.8s linear infinite;
}

@keyframes default-loader-spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

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

/* 按钮 loading 态（防重复提交守卫用） */
.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

.btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* 数据导入 modal 的格式示例块 */
.import-example {
  background: var(--bg, #f6f8fa);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-family: Consolas, 'Courier New', monospace;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 6px 0;
}

/* ===== 布局：左侧固定导航 + 右侧内容 ===== */

.app-frame {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: #f8fafc;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-user {
  padding: 20px 16px 14px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a86f7, var(--primary) 60%, var(--primary-dark));
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  box-shadow: 0 2px 6px rgba(47, 111, 237, 0.25);
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 15px;
}

.sidebar-user-sub {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

/* 导航图标统一尺寸（emoji 本身字形大小不一，用定宽容器对齐） */
.nav-ico {
  display: inline-block;
  width: 22px;
  text-align: center;
  font-size: 14px;
  line-height: 1;
  vertical-align: -1px;
}

.nav-item:hover {
  background: rgba(15, 23, 42, 0.05);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 56px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.breadcrumb {
  font-size: 15px;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 历史学年只读提示条（学年切换器配套，配色参考 badge-warning） */
.year-banner {
  padding: 8px 20px;
  background: #fef3c7;
  color: var(--warning);
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid #fde68a;
}

/* ===== 租户切换器：自定义下拉（§22/§69） ===== */

.tenant-switcher {
  position: relative;
  max-width: 260px;
}

.ts-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: #fff;
  color: var(--text, #1f2937);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ts-btn:hover {
  border-color: var(--primary, #2f6fed);
  box-shadow: 0 1px 3px rgba(47, 111, 237, 0.15);
}

.ts-btn.open {
  border-color: var(--primary, #2f6fed);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}

.ts-icon {
  font-size: 14px;
  line-height: 1;
}

.ts-name {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ts-caret {
  color: var(--text-muted, #6b7280);
  transition: transform 0.15s;
  flex-shrink: 0;
}

.ts-btn.open .ts-caret {
  transform: rotate(180deg);
}

/* 身份查看（平台管理员以成员身份查看） */
.viewas-select {
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 13px;
  padding: 0 8px;
  max-width: 210px;
}

.ts-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 240px;
  max-width: 320px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.14);
  z-index: 60;
  animation: ts-pop 0.12s ease-out;
}

@keyframes ts-pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ts-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 13.5px;
  color: var(--text, #1f2937);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.ts-item:hover {
  background: var(--bg-hover, #f3f4f6);
}

.ts-item.active {
  background: var(--primary-soft);
  color: var(--primary, #2f6fed);
  font-weight: 600;
}

.ts-item-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.ts-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ts-badge {
  flex-shrink: 0;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
}

.ts-check {
  flex-shrink: 0;
  font-weight: 700;
}

.view-container {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

/* ===== 卡片 ===== */

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}

/* ===== 按钮 ===== */

.btn {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.btn:hover {
  background: #f1f5f9;
}

.btn-primary {
  background: linear-gradient(180deg, #3b7bf6, var(--primary));
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(47, 111, 237, 0.28);
}

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

.btn-danger {
  background: linear-gradient(180deg, #ef4444, var(--danger));
  border-color: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: linear-gradient(180deg, var(--danger), #b91c1c);
  border-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.26);
}

.btn-danger:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-block {
  width: 100%;
  text-align: center;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 13px;
}

/* ===== 徽标 / 状态 ===== */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.badge-success {
  background: #dcfce7;
  color: var(--success);
}

.badge-warning {
  background: #fef3c7;
  color: var(--warning);
}

.badge-danger {
  background: #fee2e2;
  color: var(--danger);
}

.badge-leave {
  background: #f3f4f6;
  color: var(--leave);
}

.badge-info {
  background: #e0f2fe;
  color: var(--cyan);
}

/* 已归档（§63 学年归档）：历史学年被压缩归档的列表行徽标，灰底 */
.badge-archived {
  background: #eceff3;
  color: #8a94a6;
}

/* Cloudflare AI 模型档位徽标（低/经济/高/极高，四色 muted 蓝/绿/橙/红） */
.badge-cf-low {
  background: #e0f2fe;
  color: var(--cyan);
}
.badge-cf-efficient {
  background: #dcfce7;
  color: var(--success);
}
.badge-cf-high {
  background: #ffedd5;
  color: #c2410c;
}
.badge-cf-extra-high {
  background: #fee2e2;
  color: var(--danger);
}

/* ===== 表格 ===== */

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

.table th,
.table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  transition: background 0.12s ease;
}

.table th {
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: #f8fafc;
}

.table tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.015);
}

.table tr:hover td {
  background: #f4f7fc;
}

/* ===== 表单 ===== */

.form-label {
  display: block;
  margin: 10px 0 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: var(--card-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-row > * {
  flex: 1;
  min-width: 160px;
}

select.form-input {
  width: auto;
}

/* ===== 弹窗 ===== */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

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

.modal-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.modal-close {
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.confirm-msg {
  line-height: 1.7;
}

/* ===== 轻提示 ===== */

#toast-root {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast {
  background: rgba(31, 41, 55, 0.92);
  color: #fff;
  padding: 9px 18px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
  font-size: 14px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s, transform 0.25s;
  max-width: 80vw;
}

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

/* ===== 登录/注册屏 ===== */

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

.auth-logo {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-tab.active {
  background: var(--primary);
  color: #fff;
}

.auth-error {
  margin: 10px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fee2e2;
  color: var(--danger);
  font-size: 13px;
}

/* ===== 未登录首页（landing.js） ===== */

/* landing 内容可能超出视口，覆盖 .auth-screen 的垂直居中，避免顶部被裁切 */
.auth-screen.landing-mode {
  align-items: flex-start;
}

.landing {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 56px 0 32px;
}

.landing-hero {
  text-align: center;
  margin-bottom: 40px;
}

.landing-title {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 700;
  color: var(--primary);
}

.landing-tagline {
  margin: 0 0 20px;
  font-size: 15px;
  color: var(--text-muted);
}

.landing-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.landing-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}

.landing-nav-link {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.landing-nav-link:hover {
  color: var(--primary);
}

.landing-section {
  margin-bottom: 56px;
  scroll-margin-top: 24px;
}

.landing-section-title {
  margin: 0 0 6px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
}

.landing-section-sub {
  margin: 0 0 24px;
  text-align: center;
  font-size: 14px;
}

/* 功能介绍：4 列（2 行），窄屏降列 */
.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.landing-feature-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}

.landing-feature-card:hover {
  border-color: var(--primary);
}

.landing-card-icon {
  font-size: 22px;
}

.landing-card-title {
  font-weight: 600;
}

.landing-card-desc {
  font-size: 13px;
  line-height: 1.5;
}

/* 定价四档卡片 */
.landing-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  align-items: stretch;
  margin-bottom: 32px;
}

.landing-price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.landing-price-card-featured {
  border: 1px solid var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 1px 3px rgba(47, 111, 237, 0.12), 0 6px 18px rgba(47, 111, 237, 0.14);
}

.landing-price-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.landing-price-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.landing-price-amount {
  font-size: 30px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.landing-price-period {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}

.landing-price-yearly {
  margin-top: 4px;
  font-size: 12px;
}

.landing-price-list {
  list-style: none;
  margin: 16px 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  flex: 1;
}

.landing-price-list li::before {
  content: '✓';
  color: var(--success);
  margin-right: 8px;
}

.landing-price-cta {
  width: 100%;
}

/* 功能对比表：斑马行 + 中间列高亮 */
.landing-compare-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.landing-compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.landing-compare th,
.landing-compare td {
  padding: 10px 14px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.landing-compare th:first-child,
.landing-compare td:first-child {
  text-align: left;
}

.landing-compare thead th {
  background: #f8fafc;
  font-weight: 600;
}

.landing-compare tbody tr:nth-child(even) {
  background: #f8fafc;
}

.landing-compare tbody tr:last-child td {
  border-bottom: none;
}

.landing-compare .col-featured {
  background: var(--primary-soft);
  font-weight: 600;
}

.landing-compare thead .col-featured {
  color: var(--primary);
}

.landing-compare-note {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
}

.landing-trial-note {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 定价区联系卡片（微信二维码） */
.landing-contact {
  margin: 24px auto 0;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 28px;
}
.landing-contact-qr {
  width: 148px;
  height: 148px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.landing-contact-info { text-align: left; }
.landing-contact-title { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.landing-contact-sub { font-size: 13px; margin-bottom: 10px; }
.landing-contact-wechat { font-size: 15px; margin-bottom: 12px; }
.landing-contact-noqr .landing-contact-qr { display: none; }
@media (max-width: 760px) {
  .landing-contact { flex-direction: column; text-align: center; gap: 14px; }
  .landing-contact-info { text-align: center; }
}

.landing-trial-link {
  font-size: 13px;
  padding: 3px 12px;
}

.landing-footer {
  text-align: center;
  font-size: 12px;
}

@media (max-width: 900px) {
  .landing-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .landing-pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 760px) {
  .landing {
    padding: 36px 0 24px;
  }

  .landing-features-grid {
    grid-template-columns: 1fr;
  }

  .landing-pricing-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
}

/* ===== 配额用量条（设置页 §71） ===== */

.quota-item {
  margin-bottom: 12px;
}

.quota-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}

.quota-bar {
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.quota-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  transition: width 0.3s;
}

.quota-bar-fill.warn {
  background: linear-gradient(90deg, var(--warning), var(--danger));
}

/* ===== 工具条 ===== */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar .spacer {
  flex: 1;
}

/* ===== 响应式：≤760px 导航转顶部横条、卡片单列 ===== */

@media (max-width: 760px) {
  .app-frame {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 10px 14px;
  }

  .avatar {
    margin: 0;
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 6px 8px;
  }

  .nav-item {
    white-space: nowrap;
    padding: 7px 10px;
  }

  .sidebar-footer {
    display: block;
    padding: 6px 10px 10px;
  }

  .sidebar-footer .btn {
    padding: 6px 10px;
    font-size: 13px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .table {
    font-size: 13px;
  }

  .view-container {
    padding: 12px;
  }
}

/* 顶部上传进度条（App.showProgress） */
.upload-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--border, #e5e7eb);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 13px;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.upload-progress.show {
  transform: translateY(0);
  opacity: 1;
}
.upload-progress .up-label {
  color: var(--text-muted, #6b7280);
  white-space: nowrap;
}
.upload-progress .up-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}
.upload-progress .up-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f8ef7, #38b2a8);
  transition: width 0.2s ease;
}
.upload-progress .up-pct {
  min-width: 38px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted, #6b7280);
}

/* ===== 全局开关滑块：所有 checkbox 统一为滑动开关样式 ===== */
input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  vertical-align: middle;
  flex-shrink: 0;
  margin: 0;
}
input[type='checkbox']::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}
input[type='checkbox']:checked {
  background: var(--primary);
}
input[type='checkbox']:checked::before {
  transform: translateX(16px);
}
input[type='checkbox']:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== 设备模式：平板模式（大字体大按钮，适合触控） ===== */
html[data-device='tablet'] {
  font-size: 17px;
}
html[data-device='tablet'] .btn {
  padding: 12px 20px;
  font-size: 16px;
  border-radius: 10px;
}
html[data-device='tablet'] .btn-sm {
  padding: 9px 14px;
  font-size: 15px;
}
html[data-device='tablet'] .form-input {
  height: auto;
  padding: 12px 14px;
  font-size: 16px;
}
html[data-device='tablet'] .nav-item {
  padding: 14px 16px;
  font-size: 16px;
}
html[data-device='tablet'] .card {
  padding: 22px;
  border-radius: 14px;
}
html[data-device='tablet'] .nav-ico {
  font-size: 18px;
  width: 26px;
}
html[data-device='tablet'] input[type='checkbox'] {
  width: 48px;
  height: 28px;
}
html[data-device='tablet'] input[type='checkbox']::before {
  width: 22px;
  height: 22px;
}
html[data-device='tablet'] input[type='checkbox']:checked::before {
  transform: translateX(20px);
}
html[data-device='tablet'] .ts-item,
html[data-device='tablet'] .ts-btn {
  padding: 12px 14px;
  font-size: 16px;
}

/* ===== 黑夜模式（顶栏 🌙 按钮切换，本机 localStorage 持久化） ===== */
html[data-theme='dark'] {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.18);
  --cyan: #22d3ee;
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.45), 0 4px 14px rgba(0, 0, 0, 0.4);
}
html[data-theme='dark'] .sidebar {
  background: #0f172a;
}
html[data-theme='dark'] .ts-btn,
html[data-theme='dark'] .ts-menu,
html[data-theme='dark'] .viewas-select {
  background: var(--card-bg);
  color: var(--text);
}
html[data-theme='dark'] .nav-item:hover {
  background: #334155;
}
html[data-theme='dark'] .nav-item.active {
  background: var(--primary-soft);
  color: #93c5fd;
}
html[data-theme='dark'] .btn:hover {
  background: #334155;
}
html[data-theme='dark'] .btn-primary:hover {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}
html[data-theme='dark'] .btn-danger:hover {
  background: linear-gradient(180deg, var(--danger), #b91c1c);
}
html[data-theme='dark'] .table th {
  background: #0f172a;
}
html[data-theme='dark'] .table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}
html[data-theme='dark'] .table tr:hover td {
  background: #273449;
}
html[data-theme='dark'] .auth-tab {
  background: #0f172a;
}
html[data-theme='dark'] .landing-price-card {
  background: var(--card-bg);
}
html[data-theme='dark'] .landing-price-card-featured {
  background: rgba(59, 130, 246, 0.12);
}
html[data-theme='dark'] .landing-compare-wrap {
  background: var(--card-bg);
}
html[data-theme='dark'] .modal-mask {
  background: rgba(2, 6, 23, 0.65);
}
html[data-theme='dark'] ::placeholder {
  color: #64748b;
}
html[data-theme='dark'] .dct-item,
html[data-theme='dark'] .asg-item {
  background: var(--card-bg);
}
html[data-theme='dark'] .sch-cell-slot,
html[data-theme='dark'] .sch-cell-head {
  background: #0f172a;
}

/* 主题切换小按钮（顶栏） */
.theme-toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
}
.theme-toggle:hover {
  border-color: var(--primary);
}

/* ===== 商议版品牌定制：侧栏校徽/校训 + 自定义加载图标动画 ===== */
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
}
.brand-motto {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* 顶部进度条上的品牌加载图标 */
.upload-progress.has-brand-loader {
  gap: 8px;
}
.brand-loader {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.brand-loader.spin {
  animation: brand-spin 1s linear infinite;
}
.brand-loader.pulse {
  animation: brand-pulse 1.1s ease-in-out infinite;
}
.brand-loader.bounce {
  animation: brand-bounce 0.9s ease-in-out infinite;
}
.brand-loader.bar {
  animation: brand-bar 1.2s ease-in-out infinite;
}
@keyframes brand-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes brand-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.6; }
}
@keyframes brand-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes brand-bar {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(0.55); }
}

/* ===== 右下角浮动英语词典（§交接文档六） ===== */
#dict-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
}
.dict-fab {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.dict-fab:hover {
  transform: scale(1.06);
  border-color: var(--primary);
}
.dict-panel {
  position: absolute;
  right: 0;
  bottom: 54px;
  width: 300px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  padding: 12px 14px 14px;
  animation: dict-pop 0.14s ease-out;
}
@keyframes dict-pop {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.dict-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.dict-close {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
}
.dict-input {
  margin-bottom: 8px;
}
.dict-hint {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
  padding: 6px 0;
}
.dict-word {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dict-tag {
  font-size: 11px;
  font-weight: 400;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 1px 8px;
}
.dict-tag-gaokao {
  color: var(--cyan);
  background: rgba(8, 145, 178, 0.12);
}
.dict-ipa {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}
.dict-pos {
  display: inline-block;
  color: var(--primary);
  font-size: 12.5px;
  margin-top: 4px;
}
.dict-def {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.7;
}
.dict-ex {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
}
.dict-links {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}
.dict-links a {
  color: var(--primary);
  text-decoration: none;
}
.dict-links a:hover {
  text-decoration: underline;
}
.dict-sugg {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 4px 0 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.dict-sugg-item {
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--primary);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12.5px;
  cursor: pointer;
}
.dict-sugg-item:hover {
  border-color: var(--primary);
}

/* ===== 商务工作台视觉层：克制的层级、边界与密度 ===== */
.sidebar {
  background: #17384f;
  border-right-color: #28526a;
  color: #e8f1f5;
}

.sidebar-user {
  padding: 22px 16px 18px;
  border-bottom-color: rgba(232, 241, 245, 0.14);
}

.avatar {
  background: linear-gradient(135deg, #2d8195, #1d5f8f);
  box-shadow: 0 3px 10px rgba(8, 35, 52, 0.28);
}

.sidebar-user-name {
  color: #f5fafc;
}

.sidebar-user-sub {
  color: #a9c1cd;
}

.nav {
  padding: 16px 10px;
  gap: 4px;
}

.nav-item {
  padding: 10px 12px;
  border-radius: 6px;
  color: #c4d5de;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active {
  background: rgba(115, 192, 207, 0.16);
  color: #fff;
  box-shadow: inset 3px 0 0 #6ec3cb;
}

.sidebar-footer {
  padding: 14px 12px;
  border-top-color: rgba(232, 241, 245, 0.14);
}

.sidebar-footer .btn {
  background: transparent;
  border-color: rgba(232, 241, 245, 0.24);
  color: #c4d5de;
}

.sidebar-footer .btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(232, 241, 245, 0.45);
  color: #fff;
}

.topbar {
  height: 60px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 0 rgba(23, 43, 58, 0.04), 0 3px 12px rgba(23, 43, 58, 0.04);
}

.breadcrumb {
  font-size: 16px;
  letter-spacing: 0.01em;
}

.view-container {
  padding: 24px;
  max-width: 1600px;
  width: 100%;
}

.card {
  border: 1px solid rgba(220, 228, 233, 0.9);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card-title,
.modal-title {
  color: #1b3b50;
  letter-spacing: 0;
}

.btn {
  min-height: 36px;
  border-radius: 6px;
  border-color: #cbd8df;
  font-weight: 500;
}

.btn:hover {
  background: #f1f5f7;
  border-color: #a9bdc8;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 10px rgba(29, 95, 143, 0.2);
}

.btn-danger {
  background: #b84242;
  border-color: #b84242;
}

.btn-danger:hover {
  background: #963737;
  border-color: #963737;
  box-shadow: 0 4px 10px rgba(184, 66, 66, 0.18);
}

.table th {
  background: #f2f6f8;
  color: #526875;
  text-transform: none;
}

.table th,
.table td {
  padding: 11px 12px;
}

.table tr:hover td {
  background: #edf5f7;
}

.form-label {
  color: #526875;
  font-weight: 500;
}

.form-input {
  border-color: #cbd8df;
  border-radius: 6px;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 95, 143, 0.12);
}

.modal-mask {
  background: rgba(10, 29, 42, 0.52);
  backdrop-filter: blur(2px);
}

.modal {
  border: 1px solid rgba(220, 228, 233, 0.92);
  border-radius: 9px;
}

.auth-screen {
  background: linear-gradient(135deg, #edf3f5 0%, #f7f9fa 52%, #e7eff2 100%);
}

.auth-card {
  max-width: 410px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(23, 43, 58, 0.1);
}

.auth-logo,
.landing-title {
  color: #1b4f70;
}

.auth-tab {
  border-radius: 6px;
  background: #eef3f5;
}

.auth-tab.active {
  background: var(--primary);
}

.landing {
  max-width: 1080px;
}

.landing-feature-card,
.landing-price-card,
.landing-compare-wrap {
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(23, 43, 58, 0.06);
}

.landing-feature-card:hover {
  border-color: #83aebb;
  box-shadow: 0 8px 20px rgba(23, 43, 58, 0.09);
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 14px;
  }

  .view-container {
    padding: 16px 12px;
  }

  .auth-card {
    padding: 22px 18px;
  }
}

html[data-theme='dark'] .topbar {
  background: rgba(30, 41, 59, 0.94);
}

html[data-theme='dark'] .app-loading {
  background: rgba(15, 23, 42, 0.96);
}

html[data-theme='dark'] .card-title,
html[data-theme='dark'] .modal-title {
  color: var(--text);
}

html[data-theme='dark'] .auth-screen {
  background: linear-gradient(135deg, #101d29 0%, #172536 52%, #0f1a25 100%);
}

html[data-theme='dark'] .auth-card {
  background: rgba(30, 41, 59, 0.96);
}

/* ===== 统一视觉层：柔和背景、清晰层级、可感知控件 ===== */
:root {
  --primary: #176b87;
  --primary-dark: #0f5068;
  --primary-soft: rgba(23, 107, 135, 0.11);
  --cyan: #178b88;
  --bg: #eef4f3;
  --card-bg: rgba(255, 255, 255, 0.88);
  --text: #18323a;
  --text-muted: #6b7e82;
  --border: rgba(162, 187, 188, 0.55);
  --radius: 12px;
  --shadow: 0 10px 28px rgba(30, 76, 82, 0.08), 0 2px 6px rgba(30, 76, 82, 0.05);
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% 0%, rgba(121, 201, 191, 0.22), transparent 30%),
    radial-gradient(circle at 92% 8%, rgba(237, 190, 120, 0.16), transparent 24%),
    linear-gradient(rgba(255, 255, 255, 0.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 126, 130, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #f5f8f6 0%, #edf4f2 58%, #e8f0ef 100%);
  background-size: auto, auto, 32px 32px, 32px 32px, auto;
  background-attachment: fixed;
}

button,
select,
input,
textarea {
  font: inherit;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(23, 139, 136, 0.28);
  outline-offset: 2px;
}

.sidebar {
  background: linear-gradient(180deg, #123d4c 0%, #164b59 52%, #123846 100%);
  border-right: 1px solid rgba(188, 224, 218, 0.18);
  box-shadow: 8px 0 26px rgba(19, 63, 73, 0.08);
}

.nav-item {
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-item:hover {
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(117, 210, 195, 0.22), rgba(117, 210, 195, 0.08));
  box-shadow: inset 3px 0 0 #83d6c5, 0 5px 16px rgba(7, 38, 47, 0.12);
}

.topbar {
  background: rgba(248, 252, 250, 0.78);
  border-bottom-color: rgba(162, 187, 188, 0.45);
  backdrop-filter: blur(16px);
}

.view-container {
  padding: 28px clamp(16px, 3vw, 38px);
}

.card {
  border: 1px solid rgba(162, 187, 188, 0.48);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.card-title,
.modal-title {
  color: #164451;
  font-weight: 700;
}

.btn,
.ts-btn,
.viewas-select,
.theme-toggle {
  border-radius: 10px;
  border-color: rgba(133, 166, 169, 0.62);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 2px 5px rgba(26, 76, 80, 0.05);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover,
.ts-btn:hover,
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.96);
  border-color: #62a5a4;
  box-shadow: 0 5px 14px rgba(26, 76, 80, 0.1);
  transform: translateY(-1px);
}

.btn:active,
.ts-btn:active,
.theme-toggle:active,
.ts-item:active {
  transform: scale(0.98);
  transition-duration: 0.08s;
}

.btn-primary {
  background: linear-gradient(135deg, #238b91, #176b87);
  border-color: #176b87;
  box-shadow: 0 6px 14px rgba(23, 107, 135, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1b7d84, #0f5068);
  border-color: #0f5068;
  box-shadow: 0 8px 18px rgba(23, 107, 135, 0.26);
}

.btn-danger {
  background: linear-gradient(135deg, #c95a55, #ad3f45);
  border-color: #ad3f45;
}

.form-input {
  border-radius: 10px;
  border-color: rgba(133, 166, 169, 0.62);
  background: rgba(255, 255, 255, 0.78);
}

.form-input:focus {
  border-color: #3b9b9a;
  box-shadow: 0 0 0 4px rgba(59, 155, 154, 0.13), 0 3px 8px rgba(26, 76, 80, 0.06);
}

.table {
  overflow: hidden;
  border-radius: 10px;
}

.table th {
  background: rgba(218, 237, 234, 0.62);
  color: #4c6c70;
}

.table tr:hover td {
  background: rgba(207, 235, 229, 0.38);
}

.modal-mask {
  background: rgba(13, 44, 51, 0.48);
  backdrop-filter: blur(7px);
}

.modal {
  border: 1px solid rgba(196, 224, 219, 0.75);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(13, 44, 51, 0.22);
}

.ts-menu {
  transform-origin: top right;
}

html[data-theme='dark'] {
  --primary: #63c5c1;
  --primary-dark: #3da09f;
  --primary-soft: rgba(99, 197, 193, 0.16);
  --bg: #10282f;
  --card-bg: rgba(24, 52, 59, 0.88);
  --text: #e4f1ef;
  --text-muted: #9ab5b5;
  --border: rgba(126, 170, 169, 0.3);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.24), 0 2px 8px rgba(0, 0, 0, 0.16);
}

html[data-theme='dark'] body {
  background-color: #10282f;
  background-image:
    radial-gradient(circle at 10% 0%, rgba(42, 127, 126, 0.2), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(190, 130, 75, 0.12), transparent 24%),
    linear-gradient(rgba(159, 216, 208, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(159, 216, 208, 0.025) 1px, transparent 1px),
    linear-gradient(135deg, #10282f 0%, #14363d 58%, #0d232b 100%);
  background-size: auto, auto, 32px 32px, 32px 32px, auto;
}

html[data-theme='dark'] .topbar {
  background: rgba(16, 40, 47, 0.78);
  border-bottom-color: rgba(126, 170, 169, 0.28);
}

html[data-theme='dark'] .card,
html[data-theme='dark'] .modal,
html[data-theme='dark'] .ts-menu {
  background: var(--card-bg);
  border-color: var(--border);
}

html[data-theme='dark'] .card-title,
html[data-theme='dark'] .modal-title {
  color: #d8efeb;
}

html[data-theme='dark'] .btn,
html[data-theme='dark'] .ts-btn,
html[data-theme='dark'] .viewas-select,
html[data-theme='dark'] .theme-toggle,
html[data-theme='dark'] .form-input {
  background: rgba(29, 62, 69, 0.84);
  border-color: rgba(126, 170, 169, 0.42);
  color: var(--text);
}

html[data-theme='dark'] .btn:hover,
html[data-theme='dark'] .ts-btn:hover,
html[data-theme='dark'] .theme-toggle:hover {
  background: rgba(43, 83, 87, 0.92);
  border-color: #63c5c1;
}

html[data-theme='dark'] .table th {
  background: rgba(20, 58, 63, 0.92);
  color: #a7c7c4;
}

html[data-theme='dark'] .table tr:hover td {
  background: rgba(64, 126, 123, 0.18);
}

@media (max-width: 760px) {
  .view-container {
    padding: 18px 12px;
  }

  .card {
    padding: 16px;
  }
}

@media (prefers-reduced-transparency: reduce) {
  body {
    background-image: linear-gradient(135deg, #f5f8f6 0%, #edf4f2 58%, #e8f0ef 100%);
  }

  .topbar,
  .card,
  .btn,
  .ts-btn,
  .form-input {
    background: #fff;
    backdrop-filter: none;
  }

  html[data-theme='dark'] body,
  html[data-theme='dark'] .topbar,
  html[data-theme='dark'] .card,
  html[data-theme='dark'] .btn,
  html[data-theme='dark'] .ts-btn,
  html[data-theme='dark'] .form-input {
    background-image: none;
    background-color: #18343b;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .btn:active,
  .ts-btn:active,
  .theme-toggle:active,
  .ts-item:active,
  .nav-item:hover,
  .btn:hover,
  .ts-btn:hover,
  .theme-toggle:hover {
    transform: none;
  }
}

@media (prefers-contrast: more) {
  .card,
  .btn,
  .ts-btn,
  .form-input,
  .modal {
    border-color: currentColor;
  }

  .topbar {
    background: var(--card-bg);
    backdrop-filter: none;
  }
}

/* 侧栏最终主题覆盖：浅色模式使用雾白青灰，深色模式保持独立深色层级。 */
.sidebar {
  background: linear-gradient(180deg, rgba(246, 250, 248, 0.96), rgba(231, 241, 239, 0.96));
  border-right-color: rgba(132, 167, 166, 0.36);
  color: #234850;
  box-shadow: 8px 0 26px rgba(36, 82, 87, 0.06);
}

.sidebar-user {
  border-bottom-color: rgba(132, 167, 166, 0.28);
}

.sidebar-user-name {
  color: #234850;
}

.sidebar-user-sub {
  color: #6b8585;
}

.nav-item {
  color: #48676b;
}

.nav-item:hover {
  background: rgba(45, 137, 136, 0.09);
  color: #1b6469;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(55, 157, 151, 0.18), rgba(55, 157, 151, 0.06));
  color: #145d64;
  box-shadow: inset 3px 0 0 #29918e, 0 5px 16px rgba(42, 111, 109, 0.08);
}

.sidebar-footer {
  border-top-color: rgba(132, 167, 166, 0.28);
}

.sidebar-footer .btn {
  background: rgba(255, 255, 255, 0.46);
  border-color: rgba(132, 167, 166, 0.42);
  color: #48676b;
}

.sidebar-footer .btn:hover {
  background: rgba(255, 255, 255, 0.82);
  border-color: #70aaa6;
  color: #145d64;
}

html[data-theme='dark'] .sidebar {
  background: linear-gradient(180deg, #123d4c 0%, #164b59 52%, #123846 100%);
  border-right-color: rgba(188, 224, 218, 0.18);
  color: #e8f1f5;
  box-shadow: 8px 0 26px rgba(7, 25, 31, 0.22);
}

html[data-theme='dark'] .sidebar-user {
  border-bottom-color: rgba(232, 241, 245, 0.14);
}

html[data-theme='dark'] .sidebar-user-name {
  color: #f5fafc;
}

html[data-theme='dark'] .sidebar-user-sub {
  color: #a9c1cd;
}

html[data-theme='dark'] .nav-item {
  color: #c4d5de;
}

html[data-theme='dark'] .nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

html[data-theme='dark'] .nav-item.active {
  background: linear-gradient(90deg, rgba(117, 210, 195, 0.22), rgba(117, 210, 195, 0.08));
  color: #fff;
  box-shadow: inset 3px 0 0 #83d6c5, 0 5px 16px rgba(7, 38, 47, 0.12);
}

html[data-theme='dark'] .sidebar-footer {
  border-top-color: rgba(232, 241, 245, 0.14);
}

html[data-theme='dark'] .sidebar-footer .btn {
  background: transparent;
  border-color: rgba(232, 241, 245, 0.24);
  color: #c4d5de;
}

html[data-theme='dark'] .sidebar-footer .btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(232, 241, 245, 0.45);
  color: #fff;
}

/* 平台管理：默认收起，展开后才展示并加载区块内容。 */
.admin-section {
  margin-bottom: 14px;
  border: 1px solid rgba(162, 187, 188, 0.48);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.admin-section-summary {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  color: #164451;
  font-size: 15px;
  font-weight: 700;
  user-select: none;
}

.admin-section-summary::-webkit-details-marker {
  display: none;
}

.admin-section-summary::after {
  content: '＋';
  margin-left: auto;
  color: var(--primary);
  font-size: 20px;
  font-weight: 400;
  transition: transform 0.18s ease;
}

.admin-section[open] .admin-section-summary {
  border-bottom: 1px solid rgba(162, 187, 188, 0.36);
  background: rgba(218, 237, 234, 0.28);
}

.admin-section[open] .admin-section-summary::after {
  transform: rotate(45deg);
}

.admin-section-body {
  padding: 18px 20px 20px;
}

html[data-theme='dark'] .admin-section {
  background: var(--card-bg);
  border-color: var(--border);
}

html[data-theme='dark'] .admin-section-summary {
  color: #d8efeb;
}

html[data-theme='dark'] .admin-section[open] .admin-section-summary {
  background: rgba(64, 126, 123, 0.14);
  border-bottom-color: var(--border);
}

@media (max-width: 760px) {
  .admin-section-summary {
    min-height: 52px;
    padding: 14px 16px;
  }

  .admin-section-body {
    padding: 14px 16px 16px;
  }
}
