/* =============================================
   党支部学习管理系统 - 完整样式表
   保留所有原有组件 + 高级视觉升级
   ============================================= */

/* === 字体 === */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700;800&display=swap');

/* === 重置 === */
*, ::before, ::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --red-primary: #c41230;
  --red-hover: #a30f27;
  --red-dark: #7a1515;
  --red-light: #fdf2f3;
  --red-subtle: #faeaea;
  --gold: #c8961e;
  --gold-light: #fdf6e3;

  --bg-base: #F9FAFB;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;

  --gray-50: #fafaf9;
  --gray-100: #f0efed;
  --gray-200: #e4e2de;
  --gray-300: #ccc9c4;
  --gray-400: #9a9690;
  --gray-500: #6e6a63;
  --gray-600: #4a4640;
  --gray-700: #33302c;
  --gray-800: #1f1d1a;
  --gray-900: #111009;

  --green: #1a7a4a;
  --green-bg: #e8f5ee;
  --orange: #b5680a;
  --orange-bg: #fef3e2;
  --red-alert: #c0392b;
  --red-alert-bg: #fdecea;

  /* Warm-tinted shadows (matching warm gray palette) */
  --shadow-card: 0 1px 3px rgba(31,29,26,0.04), 0 4px 16px rgba(31,29,26,0.05);
  --shadow-md: 0 4px 20px rgba(31,29,26,0.07);
  --shadow-lg: 0 8px 40px rgba(31,29,26,0.09);
  --shadow-red: 0 4px 20px rgba(196,18,48,0.10);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-8: 8px;
  --radius-12: 12px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  /* Transition tiers */
  --ease-micro: 0.15s ease;
  --ease-std: 0.2s ease;
  --ease-slow: 0.3s ease;
}

html {
  font-size: clamp(14px, 1vw + 11px, 16px);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--gray-700);
  line-height: 1.6;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ========================
   头部导航
   ======================== */
.header {
  background: white;
  color: var(--gray-800);
  padding: 0 50px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--red-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #ffd700;
  flex-shrink: 0;
  box-shadow: var(--shadow-red);
}

.logo-text h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}

.logo-text span {
  font-size: 11px;
  color: var(--gray-400);
}

.nav {
  display: flex;
  gap: 4px;
}

.nav a {
  color: var(--gray-600);
  font-size: clamp(12px, 1.2vw, 15px);
  font-weight: 500;
  padding: clamp(6px, 0.8vw, 10px) clamp(10px, 1.2vw, 18px);
  border-radius: var(--radius-8);
  transition: all var(--ease-std);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav a:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.nav a.active {
  background: var(--red-light);
  color: var(--red-primary);
  font-weight: 600;
}

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

.user-avatar {
  width: 38px;
  height: 38px;
  background: var(--red-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #ffd700;
  box-shadow: var(--shadow-red);
  flex-shrink: 0;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
}

.user-role {
  font-size: 12px;
  color: var(--gray-400);
}

.action-btn {
  background: var(--gray-100);
  color: var(--gray-700);
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease-std);
  font-family: var(--font-sans);
}
.action-btn:hover { background: var(--gray-200); }

/* ========================
   主内容区
   ======================== */
.main-content {
  max-width: 1400px;
  margin: 30px auto;
  padding: 0 50px;
}

/* ========================
   卡片通用样式
   ======================== */
.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0,0,0,0.04);
  overflow: hidden;
  margin-bottom: var(--space-5);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-800);
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: -0.01em;
}

.card-title .more {
  font-size: 13px;
  color: var(--red-primary);
  font-weight: 500;
  transition: opacity 0.2s;
}
.card-title .more:hover { opacity: 0.7; }

/* ========================
   快捷入口（首页）
   ======================== */
.quick-entry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px;
}

.quick-item {
  background: white;
  color: var(--gray-800);
  padding: 28px 20px;
  border-radius: var(--radius-12);
  text-align: center;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  border: 1.5px solid var(--gray-200);
  text-decoration: none;
  display: block;
}

.quick-item::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(196,18,48,0.04) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.28s;
}

.quick-item:hover {
  transform: translateY(-3px);
  border-color: var(--red-primary);
  box-shadow: 0 6px 24px rgba(196,18,48,0.1);
}

.quick-item:hover::before { opacity: 1; }

.quick-icon {
  font-size: 34px;
  margin-bottom: 12px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.quick-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--gray-700);
}

/* ========================
   首页布局
   ======================== */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

.notice-board {
  border-left: 4px solid var(--red-primary);
}

.notice-board .card-title {
  color: var(--red-primary);
}

.notice-item {
  padding: 14px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all var(--ease-micro);
}

.notice-item:last-child { border-bottom: none; }

.notice-item:hover {
  background: var(--red-light);
}

.notice-item > div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--gray-700);
  flex: 1;
  min-width: 0;
}

.notice-tag {
  background: var(--red-primary);
  color: white;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.notice-date {
  color: var(--gray-300);
  font-size: 12px;
  flex-shrink: 0;
  margin-left: 12px;
}

/* ========================
   学习资料列表
   ======================== */
.learning-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  padding: 0 24px;
  padding-top: 20px;
}

.tab-item {
  padding: 8px 18px;
  background: var(--gray-100);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
}

.tab-item:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

.tab-item.active {
  background: var(--red-primary);
  color: white;
}

.material-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 24px;
}

.material-item {
  background: var(--gray-50);
  border-radius: var(--radius-12);
  padding: 20px;
  cursor: pointer;
  transition: all var(--ease-std);
  border: 1.5px solid transparent;
  position: relative;
}

.material-item:hover {
  background: #fff;
  border-color: var(--red-primary);
  box-shadow: 0 4px 20px rgba(196,18,48,0.1);
  transform: translateY(-2px);
}

.material-type {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.03em;
}

.type-doc { background: #e3f2fd; color: #1565c0; }
.type-video { background: #f3e5f5; color: #7b1fa2; }
.type-img { background: #fff3e0; color: #e65100; }

.material-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--gray-800);
  line-height: 1.4;
}

.material-info {
  font-size: 12px;
  color: var(--gray-400);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.material-info span:first-child {
  color: var(--gray-500);
}

/* ========================
   党务事项
   ======================== */
.affairs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 24px;
}

.affair-item {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-12);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--ease-std);
  background: white;
}

.affair-item:hover {
  border-color: var(--red-primary);
  box-shadow: 0 4px 20px rgba(196,18,48,0.12);
  transform: translateY(-2px);
}

.affair-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(145deg, var(--red-primary), var(--red-dark));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
  color: white;
  box-shadow: var(--shadow-red);
}

.affair-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--gray-800);
}

.affair-desc {
  font-size: 13px;
  color: var(--gray-500);
}

/* ========================
   登录页
   ======================== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--red-primary) 0%, #8b0000 100%);
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  top: -200px;
  right: -200px;
}

.login-container::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.02);
  bottom: -100px;
  left: -100px;
}

.login-box {
  background: white;
  padding: 48px 52px;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  width: 420px;
  position: relative;
  z-index: 1;
}

.login-title {
  text-align: center;
  margin-bottom: 36px;
}

.login-title .login-logo {
  width: 64px;
  height: 64px;
  background: var(--red-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-red);
}

.login-title h2 {
  color: var(--gray-800);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-title p {
  color: var(--gray-400);
  font-size: 14px;
  margin-top: 6px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--gray-800);
  background: var(--gray-50);
  transition: all var(--ease-std);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--red-primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(196,18,48,0.1);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(145deg, var(--red-primary), var(--red-dark));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease-std);
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-red);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(196,18,48,0.4);
}

/* ========================
   上传区域
   ======================== */
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  cursor: pointer;
  transition: all var(--ease-std);
  background: var(--gray-50);
  margin: 24px;
}

.upload-area:hover {
  border-color: var(--red-primary);
  background: var(--red-light);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.upload-hint {
  color: var(--gray-400);
  font-size: 14px;
}

/* ========================
   管理员表格
   ======================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}

.data-table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-600);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td { background: var(--gray-50); }

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.status-tag::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-pending { background: var(--orange-bg); color: var(--orange); }
.status-approved { background: var(--green-bg); color: var(--green); }
.status-rejected { background: var(--red-alert-bg); color: var(--red-alert); }

/* ========================
   底部
   ======================== */
.footer {
  background: var(--gray-800);
  color: var(--gray-400);
  text-align: center;
  padding: 28px;
  margin-top: 50px;
  font-size: 13px;
}

/* ========================
   按钮（通用）
   ======================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-8);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--ease-micro);
  border: none;
  white-space: nowrap;
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}
.btn-secondary:hover { background: var(--gray-200); }

.btn-outline {
  background: transparent;
  color: var(--gray-600);
  border: 1.5px solid var(--gray-300);
}
.btn-outline:hover { border-color: var(--gray-400); background: var(--gray-50); }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #156e3d; }

.btn-danger { background: var(--red-alert); color: #fff; }
.btn-danger:hover { background: #a93226; }

/* ========================
   搜索栏
   ======================== */
.search-bar {
  display: flex;
  gap: 10px;
  padding: 0 24px 20px;
}

.search-bar input {
  flex: 1;
  padding: 11px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-sans);
  transition: all var(--ease-micro);
  background: var(--gray-50);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--red-primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(196,18,48,0.08);
}

.search-bar .btn-primary {
  width: 100px;
  padding: 11px;
  font-size: 14px;
}

/* ========================
   响应式（流动式）
   ======================== */
/* 大平板 ≤1200px */
@media (max-width: 1200px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
  .material-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .affairs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-entry {
    grid-template-columns: repeat(2, 1fr);
  }
  .login-box {
    width: clamp(340px, 80vw, 420px);
  }
}

/* 平板 ≤992px */
@media (max-width: 992px) {
  .header {
    flex-wrap: wrap;
    padding: 10px 20px;
  }
  .nav {
    order: 3;
    width: 100%;
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding-top: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav a {
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 13px;
    flex-shrink: 0;
  }
  .logo-text span {
    display: none;
  }
  .user-name {
    display: none;
  }
  .user-role {
    display: none;
  }
  .main-content {
    padding: 0 20px;
  }
  .affairs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .global-search-input {
    width: 160px;
  }
}

/* 手机 ≤768px */
@media (max-width: 768px) {
  html {
    font-size: 13px;
  }

  /* 头部 */
  .header {
    padding: 8px 12px;
    height: 64px;
    gap: 8px;
  }
  .logo {
    flex-shrink: 0;
  }
  .logo-icon {
    width: 36px;
    height: 36px;
    font-size: 17px;
  }
  .logo-text h1 {
    font-size: 14px;
  }

  /* 导航 — 横向滚动 */
  .nav {
    order: 3;
    width: 100%;
    display: flex;
    overflow-x: auto;
    gap: 2px;
    padding: 6px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav a {
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
  }
  .nav a.active {
    background: var(--red-primary);
    color: #fff;
  }

  /* 用户信息 */
  .user-info {
    font-size: 12px;
    gap: 6px;
  }
  .user-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  /* 搜索与通知 */
  .header-actions {
    gap: 6px;
  }
  .global-search-input {
    width: 120px;
    font-size: 12px;
    padding: 5px 10px 5px 28px;
  }
  .global-search-results {
    min-width: 280px;
    right: -40px;
    left: auto;
  }
  .notif-panel {
    width: 290px;
    right: -20px;
  }
  .notif-bell {
    font-size: 18px;
  }

  /* 主内容 */
  .main-content {
    padding: 12px 10px;
    margin: 16px auto;
  }
  .card {
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 10px;
  }
  .quick-entry {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
    padding: 14px;
  }
  .quick-item {
    padding: 14px 10px;
  }
  .quick-icon {
    font-size: 26px;
  }
  .quick-title {
    font-size: 12px;
  }
  .material-list {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }
  .affairs-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }
  .card-title {
    font-size: 15px;
    padding: 16px 18px 14px;
  }
  .notice-item > div {
    font-size: 13px;
  }

  /* 学习中心 */
  .page-hero {
    padding: 20px 16px;
    border-radius: 12px;
  }
  .page-hero h2 {
    font-size: 18px;
  }
  .page-hero-stats {
    gap: 16px;
  }
  .page-hero-stat-num {
    font-size: 20px;
  }
  .learning-tabs {
    padding: 0 16px;
    padding-top: 16px;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .learning-tabs::-webkit-scrollbar {
    display: none;
  }
  .tab-item {
    padding: 6px 14px;
    font-size: 12px;
    white-space: nowrap;
  }

  /* 表格响应式 */
  .data-table {
    font-size: 12px;
  }
  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  thead {
    display: none;
  }
  tbody tr {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
  }
  tbody td {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border: none;
    font-size: 13px;
  }
  tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #666;
    margin-right: 12px;
    flex-shrink: 0;
  }

  /* 模态框全屏化 */
  .modal-overlay .modal-content,
  .modal-overlay > div {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh;
    margin: 5vh auto;
    border-radius: 12px;
  }
  .modal-overlay {
    padding: 0 8px;
  }

  /* 文件预览 */
  .file-preview-area,
  #filePreviewArea {
    max-height: 50vh;
    overflow-y: auto;
  }
  .docx-preview-wrap {
    max-height: 50vh;
    padding: 12px;
  }

  /* 表单 — 防止 iOS 缩放 */
  input[type="text"],
  input[type="password"],
  input[type="search"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* 按钮触控优化 */
  button, .btn, .action-btn, .export-btn {
    min-height: 40px;
    min-width: 40px;
    padding: 8px 14px;
    font-size: 13px;
  }

  /* 党务中心 */
  .category-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* 上传页 */
  .upload-section {
    padding: 12px;
  }
  .drop-zone {
    padding: 20px;
    min-height: 120px;
  }
  .drop-zone-hint {
    font-size: 12px;
  }

  /* 标签页横向滚动 */
  .tab-bar, .status-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 4px;
  }
  .tab-bar::-webkit-scrollbar,
  .status-tabs::-webkit-scrollbar {
    display: none;
  }
  .tab-bar span, .status-tabs span {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* 工具栏 */
  .panel-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .export-btn-group {
    flex-wrap: wrap;
  }

  /* 登录框 */
  .login-box {
    padding: 32px 24px;
    width: calc(100vw - 40px);
    max-width: 380px;
  }
  .search-bar {
    padding: 0 16px 16px;
    flex-wrap: wrap;
  }
  .search-bar input {
    font-size: 13px;
    padding: 10px 14px;
  }
  .page-header h2 {
    font-size: 20px;
  }

  /* 页脚 */
  .page-footer {
    padding: 16px 12px;
    font-size: 11px;
  }
}

/* 小屏手机 ≤480px */
@media (max-width: 480px) {
  .header {
    padding: 6px 10px;
    height: 52px;
  }
  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
  .logo-text h1 {
    font-size: 13px;
  }
  .nav a {
    padding: 5px 8px;
    font-size: 11px;
  }
  .quick-entry {
    gap: 8px;
    padding: 10px;
  }
  .quick-icon {
    font-size: 22px;
  }
  .quick-title {
    font-size: 11px;
  }
  .material-list {
    padding: 10px;
  }
  .affairs-grid {
    padding: 10px;
  }
}

/* ========================
   页面头部（上传/管理页面）
   ======================== */
.page-header {
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.page-header p {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 6px;
}

/* ========================
   表单样式
   ======================== */
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-sans);
  transition: all 0.18s;
}

.form-control:focus {
  outline: none;
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(196,18,48,0.08);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a8a49c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
/* ===== 内容预览区样式 ===== */
.learning-content-area { min-height: 200px; margin-top: 16px; }
.video-container { position: relative; background: #000; border-radius: 8px; overflow: hidden; }
.video-container video { width: 100%; max-height: 480px; display: block; }
.audio-player { background: #fff8f0; border: 1px solid #f0e0c0; border-radius: 12px; padding: 16px 20px; display: flex; align-items: center; gap: 16px; }
.audio-info { display: flex; align-items: center; gap: 12px; flex: 1; }
.audio-icon-wrap { font-size: 32px; }
.audio-title-block { font-size: 13px; }
.audio-material-title { font-weight: 600; color: #333; margin-bottom: 4px; }
.audio-material-sub { color: #888; font-size: 12px; }
.audio-player audio { width: 100%; height: 40px; flex-shrink: 0; }
.image-preview { text-align: center; padding: 8px; }
.image-preview img { max-width: 100%; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.url-preview { width: 100%; height: 480px; border: none; border-radius: 8px; background: #fff; }
.doc-preview iframe { width: 100%; height: 480px; border: none; border-radius: 8px; }
.doc-fallback { text-align: center; padding: 12px; background: #f8f8f8; border-radius: 8px; margin-top: 8px; }
.doc-fallback a { color: var(--red-primary); font-weight: 600; }
.download-btn { display: inline-block; padding: 8px 20px; background: var(--red-primary); color: #fff; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; transition: all 0.2s; }
.download-btn:hover { background: #a01025; transform: translateY(-1px); }
.no-preview { text-align: center; padding: 40px 20px; }
.no-preview-icon { font-size: 48px; margin-bottom: 12px; }
.no-preview-text { font-size: 14px; color: #999; margin-bottom: 16px; }
.no-preview-link { display: inline-block; padding: 8px 24px; border: 2px solid var(--red-primary); color: var(--red-primary); border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; transition: all 0.2s; }
.no-preview-link:hover { background: var(--red-primary); color: #fff; }

/* ===== PDF 预览样式 ===== */
.pdf-preview { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.pdf-viewer-wrap {
    background: #f5f5f5; border-radius: 8px; overflow: auto;
    min-height: 480px; max-height: 70vh;
    display: flex; flex-direction: column; align-items: center;
    justify-content: flex-start; position: relative;
}
.pdf-loading { display: flex; flex-direction: column; align-items: center; padding: 40px; gap: 12px; }
.pdf-loading-icon { font-size: 40px; }
.pdf-loading-text { font-size: 14px; color: #666; }
.pdf-loading-bar { width: 200px; height: 4px; background: #e0e0e0; border-radius: 2px; overflow: hidden; }
.pdf-loading-progress { height: 100%; background: var(--red-primary); border-radius: 2px; width: 30%; animation: pdfLoading 1.5s ease-in-out infinite; }
@keyframes pdfLoading { 0% { width: 0%; margin-left: 0%; } 50% { width: 60%; margin-left: 20%; } 100% { width: 0%; margin-left: 100%; } }
.pdf-preview canvas { display: block; max-width: 100%; margin: 0 auto; }
.pdf-top-bar { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 8px; background: #f0f0f0; border-radius: 6px 6px 0 0; }
.pdf-nav-btn { background: var(--red-primary); color: #fff; border: none; padding: 5px 14px; border-radius: 4px; cursor: pointer; font-size: 13px; transition: background 0.2s; }
.pdf-nav-btn:hover:not(:disabled) { background: var(--red-dark); }
.pdf-nav-btn:disabled { background: #ccc; cursor: not-allowed; }
.pdf-counter { font-size: 13px; color: #333; font-weight: 500; min-width: 60px; text-align: center; }

/* ===== PPT 预览样式 ===== */
.ppt-preview-wrap { display: flex; flex-direction: column; gap: 12px; }
.ppt-controls { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; background: #f5f5f5; border-radius: 8px; }
.ppt-btn { padding: 6px 16px; background: var(--red-primary); color: #fff; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.ppt-btn:hover { background: #a01025; }
.ppt-btn:disabled { background: #ccc; cursor: not-allowed; }
.ppt-counter { font-size: 13px; color: #666; min-width: 80px; text-align: center; }
.ppt-slide { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 24px; min-height: 300px; font-size: 15px; line-height: 1.8; color: #333; white-space: pre-wrap; word-break: break-all; }
.ppt-slide h1 { font-size: 20px; color: var(--red-primary); border-bottom: 2px solid var(--red-light); padding-bottom: 8px; margin-bottom: 16px; }
.ppt-slide h2 { font-size: 17px; color: #c41230; margin-bottom: 12px; }
.ppt-slide h3 { font-size: 15px; color: #333; margin-bottom: 8px; }

/* ===== 文章/资源预览样式 ===== */
.article-preview { background: #fff; border-radius: 8px; padding: 20px; font-size: 15px; line-height: 1.8; color: #333; }
.article-preview h1 { font-size: 20px; color: var(--red-primary); margin-bottom: 12px; border-left: 4px solid var(--red-primary); padding-left: 12px; }
.article-preview h2 { font-size: 17px; color: #333; margin: 16px 0 8px; }
.article-preview p { margin-bottom: 12px; text-indent: 2em; }
.article-preview ul, .article-preview ol { padding-left: 24px; margin-bottom: 12px; }
.article-preview li { margin-bottom: 6px; }
.article-preview blockquote { border-left: 4px solid var(--gold); background: #fffbe6; padding: 12px 16px; margin: 12px 0; border-radius: 6px; font-style: italic; color: #555; }
.ext-link-card { display: flex; align-items: center; gap: 12px; background: #f0f7ff; border: 1px solid #cce0ff; border-radius: 10px; padding: 16px 20px; }
.ext-link-card-icon { font-size: 28px; }
.ext-link-card-info { flex: 1; }
.ext-link-card-title { font-weight: 600; color: #1a56db; font-size: 15px; margin-bottom: 4px; }
.ext-link-card-url { font-size: 12px; color: #888; word-break: break-all; }
.ext-link-open-btn { padding: 6px 16px; background: #1a56db; color: #fff; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }

/* ===== 学习进度追踪器样式 ===== */
.progress-tracker { margin-top: 16px; }
.progress-bar { height: 8px; background: #e8e8e8; border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--red-primary), var(--gold)); border-radius: 4px; transition: width 0.4s ease; }
.progress-steps { display: flex; justify-content: space-between; gap: 4px; }
.progress-step { flex: 1; text-align: center; padding: 8px 2px; border-radius: 6px; font-size: 11px; background: #f0f0f0; color: #888; transition: all 0.3s; cursor: default; }
.progress-step.active { background: var(--red-light); color: var(--red-primary); font-weight: 600; }
.progress-step.done { background: var(--red-primary); color: #fff; }
.progress-step-text { font-weight: 600; display: block; margin-bottom: 2px; font-size: 13px; }
.progress-step-sub { display: block; font-size: 10px; opacity: 0.8; }
.mark-learned-btn { width: 100%; padding: 10px; background: linear-gradient(135deg, var(--gold), #e6b800); color: #7a4a00; border: none; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.mark-learned-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255,215,0,0.4); }

/* ===== 弹窗标签样式 ===== */
.modal-material-tags .tag { display: inline-block; background: var(--red-light); color: var(--red-primary); padding: 2px 10px; border-radius: 12px; font-size: 12px; margin: 2px; }

/* ===== [F] 通知铃铛 & 面板 ===== */
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.notif-bell { position: relative; cursor: pointer; font-size: 20px; padding: 6px; border-radius: 50%; transition: background 0.2s; user-select: none; }
.notif-bell:hover { background: rgba(0,0,0,0.06); }
.notif-badge { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; line-height: 18px; text-align: center; background: #e53935; color: #fff; font-size: 11px; font-weight: 700; border-radius: 9px; padding: 0 4px; display: none; }
.notif-panel { position: absolute; top: 100%; right: 0; width: 340px; max-height: 420px; background: #fff; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.15); z-index: 9999; display: none; overflow: hidden; }
.notif-panel.active { display: block; }
.notif-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #eee; font-weight: 600; font-size: 14px; }
.notif-panel-header button { background: none; border: none; color: var(--red-primary); font-size: 12px; cursor: pointer; }
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid #f5f5f5; cursor: pointer; transition: background 0.15s; }
.notif-item:hover { background: #fafafa; }
.notif-item.unread { background: #fff8f0; border-left: 3px solid var(--gold); }
.notif-item.unread:hover { background: #fff3e0; }
.notif-title { font-size: 13px; font-weight: 500; color: #333; margin-bottom: 4px; line-height: 1.4; }
.notif-time { font-size: 11px; color: #999; }

/* ===== [I] 全局搜索 ===== */
.global-search-wrap { position: relative; }
.global-search-input { width: 220px; padding: 7px 14px 7px 34px; border: 1px solid #ddd; border-radius: 20px; font-size: 13px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; background: #f8f8f8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 10px center no-repeat; }
.global-search-input:focus { border-color: var(--red-primary); box-shadow: 0 0 0 3px rgba(196,18,48,0.08); background-color: #fff; }
.global-search-results { position: absolute; top: 100%; left: 0; right: 0; min-width: 320px; max-height: 400px; background: #fff; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.15); z-index: 9999; display: none; overflow-y: auto; margin-top: 4px; }
.global-search-results.active { display: block; }
.search-group { padding: 4px 0; }
.search-group-title { padding: 6px 16px; font-size: 11px; color: #999; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.search-item { display: flex; align-items: center; gap: 8px; padding: 8px 16px; text-decoration: none; color: #333; transition: background 0.15s; font-size: 13px; }
.search-item:hover { background: #f5f5f5; }
.search-icon { font-size: 16px; flex-shrink: 0; }
.search-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-meta { font-size: 11px; color: #999; flex-shrink: 0; }
.search-empty { text-align: center; padding: 24px; color: #999; font-size: 13px; }

/* ===== [J] 导出按钮 ===== */
.export-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: #fff; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; color: #555; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.export-btn:hover { border-color: var(--red-primary); color: var(--red-primary); background: #fff8f8; }
.export-btn svg, .export-btn .export-icon { width: 16px; height: 16px; }
.export-btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== [K] 无障碍 & 焦点样式 ===== */
*:focus-visible { outline: 2px solid var(--red-primary); outline-offset: 2px; border-radius: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--red-primary); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[role="button"] { cursor: pointer; }
[aria-hidden="true"] { display: none !important; }

/* ===== [H] 统一页脚 ===== */
.page-footer { text-align: center; padding: 20px; color: #999; font-size: 12px; border-top: 1px solid #eee; margin-top: 40px; }
.page-footer a { color: var(--red-primary); text-decoration: none; }

/* ===== [H] 统一卡片 & 面板增强 ===== */
.panel-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.panel-toolbar h3 { margin: 0; font-size: 16px; }

/* ===== [E] 移动端深度优化 ===== */

/* 平板适配 (768px - 1024px) */
/* 小屏手机 ≤374px */
@media (max-width: 374px) {
    .logo-text h1 { font-size: 12px; }
    .global-search-input { width: 100px; }
    .quick-entry { grid-template-columns: 1fr !important; }
    .category-grid { grid-template-columns: 1fr !important; }
    .header-actions { gap: 4px; }
    .notif-panel { width: 260px; }
}

/* 触控增强 */
@media (hover: none) and (pointer: coarse) {
    /* 触控设备增强点击区域 */
    .nav a, .tab-bar span, .status-tabs span, .filter-tab { padding: 10px 14px; }
    .notif-item { padding: 14px 16px; }
    .search-item { padding: 12px 16px; }
    
    /* 禁用hover效果（触控设备） */
    .btn:hover, .action-btn:hover { transform: none; }
    
    /* 增强滚动体验 */
    .main-content, .modal-content, .notif-list, .global-search-results {
        -webkit-overflow-scrolling: touch;
    }
}

/* 暗色模式（可选增强） */
@media (prefers-color-scheme: dark) {
    .notif-panel, .global-search-results { background: #1e1e1e; color: #e0e0e0; }
    .notif-item:hover { background: #2a2a2a; }
    .search-item:hover { background: #2a2a2a; }
}

/* ===== [D] DOCX 在线预览 ===== */
.docx-preview-wrap { max-height: 600px; overflow-y: auto; padding: 20px; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; }
.docx-preview-wrap table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.docx-preview-wrap td, .docx-preview-wrap th { border: 1px solid #ccc; padding: 6px 10px; font-size: 13px; }
.docx-preview-wrap img { max-width: 100%; height: auto; }
.docx-preview-wrap h1 { font-size: 20px; color: var(--red-primary); margin: 16px 0 8px; }
.docx-preview-wrap h2 { font-size: 17px; margin: 14px 0 6px; }
.docx-preview-wrap p { margin-bottom: 8px; line-height: 1.8; }

/* ===== PDF CANVAS TOUCH & MOBILE ENHANCEMENTS ===== */
.pdf-preview canvas {
    display: block; max-width: 100%; margin: 0 auto;
    touch-action: manipulation; /* Allow pinch-zoom on canvas */
    cursor: grab;
    transition: transform 0.05s linear;
}
.pdf-preview canvas:active { cursor: grabbing; }

/* Mobile PDF toolbar: wrap and center controls */
.pdf-top-bar {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; padding: 8px 12px; background: #f0f0f0; border-radius: 6px 6px 0 0;
    flex-wrap: wrap;
}
.pdf-zoom-bar {
    display: flex; align-items: center; gap: 4px;
    background: white; border-radius: 6px; padding: 2px 4px;
    border: 1px solid #ddd;
}
.pdf-zoom-btn {
    width: 32px; height: 28px; border: none; background: transparent;
    cursor: pointer; font-size: 16px; color: #555; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.pdf-zoom-btn:hover { background: #e8e8e8; }

/* Download button (centered, prominent) */
.download-btn {
    display: inline-block; padding: 10px 24px;
    background: var(--red-primary); color: white; border-radius: 8px;
    text-decoration: none; font-weight: 600; font-size: 14px;
    transition: background 0.2s;
}
.download-btn:hover { background: var(--red-dark); }

/* Touch hint on mobile */
@media (hover: none) and (pointer: coarse) {
    .pdf-preview canvas { cursor: default; }
    .pdf-top-bar { padding: 6px 8px; gap: 6px; }
    .pdf-nav-btn { padding: 6px 12px; font-size: 12px; }
    .pdf-zoom-btn { width: 36px; height: 32px; font-size: 18px; }
}

/* DOCX preview mobile improvements */
.docx-preview-wrap {
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}
@media (max-width: 768px) {
    .docx-preview-wrap {
        max-height: 400px;
        padding: 12px 16px;
        font-size: 14px;
    }
    .docx-preview-wrap h1 { font-size: 18px; }
    .docx-preview-wrap h2 { font-size: 15px; }
    .pdf-viewer-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ===================================================
   Taste Skill 增强 — 设计品质提升
   =================================================== */

/* === P1: :active 按压反馈 — 全局按钮/卡片 === */
.btn-primary:active, .btn-success:active, .btn-danger:active,
.btn-secondary:active, .btn-outline:active, .action-btn:active {
    transform: translateY(1px) scale(0.98);
    opacity: 0.92;
    transition: all var(--ease-micro);
}
.export-btn:active, .ppt-btn:active, .mark-learned-btn:active,
.download-btn:active, .notif-panel-header button:active {
    transform: translateY(1px);
    opacity: 0.9;
    transition: all var(--ease-micro);
}
.quick-item:active, .material-item:active, .affair-item:active {
    transform: scale(0.98);
    transition: transform var(--ease-micro);
}
.nav a:active { transform: scale(0.96); transition: transform var(--ease-micro); }

/* === P1: 共享模态框样式 === */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(17,16,9,0.45);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 10000; display: flex; align-items: center; justify-content: center;
    padding: 20px; opacity: 0; transition: opacity var(--ease-std);
    pointer-events: none;
}
.modal-overlay.active,
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal-content {
    background: var(--bg-surface); border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(17,16,9,0.18), 0 4px 16px rgba(17,16,9,0.08);
    max-width: 600px; width: 100%; max-height: 85vh; overflow-y: auto;
    transform: translateY(12px) scale(0.97);
    transition: transform var(--ease-slow);
}
.modal-overlay.active .modal-content,
.modal-overlay.show .modal-content { transform: translateY(0) scale(1); }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-5); border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 { font-size: 17px; font-weight: 600; color: var(--gray-800); letter-spacing: -0.01em; }
.modal-close {
    width: 32px; height: 32px; border-radius: 50%; border: none;
    background: var(--gray-100); color: var(--gray-500); font-size: 16px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all var(--ease-micro);
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-700); }
.modal-body { padding: var(--space-5); }
.modal-footer {
    display: flex; justify-content: flex-end; gap: var(--space-3);
    padding: var(--space-4) var(--space-5); border-top: 1px solid var(--gray-100);
}
.btn-modal-submit {
    padding: 10px 24px; border-radius: var(--radius-8); border: none;
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: all var(--ease-std);
}
.btn-modal-submit:active { transform: translateY(1px) scale(0.98); }
.btn-modal-submit.primary { background: var(--red-primary); color: #fff; }
.btn-modal-submit.primary:hover { background: var(--red-hover); }
.btn-modal-submit.ghost { background: var(--gray-100); color: var(--gray-600); }
.btn-modal-submit.ghost:hover { background: var(--gray-200); }

/* === P1: 加载/空/错误 状态组件 === */
.state-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: var(--space-7) var(--space-5); text-align: center; min-height: 160px;
}
.state-placeholder-icon { font-size: 36px; margin-bottom: var(--space-3); opacity: 0.5; }
.state-placeholder-text { font-size: 14px; color: var(--gray-400); line-height: 1.6; }
.state-placeholder-action { margin-top: var(--space-4); }

.state-loading .state-placeholder-icon {
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton loader for card lists */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { height: 120px; margin-bottom: var(--space-4); border-radius: var(--radius-md); }
.skeleton-line { height: 14px; margin-bottom: var(--space-2); }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w40 { width: 40%; }

/* === P2: 共享 page-hero 组件 === */
.page-hero {
    background: linear-gradient(135deg, var(--red-primary) 0%, var(--red-dark) 100%);
    color: #fff; padding: var(--space-6) var(--space-6);
    border-radius: var(--radius-lg); margin-bottom: var(--space-5);
    position: relative; overflow: hidden;
}
.page-hero::before {
    content: ''; position: absolute; width: 280px; height: 280px;
    border-radius: 50%; background: rgba(255,255,255,0.04);
    top: -120px; right: -60px;
}
.page-hero::after {
    content: ''; position: absolute; width: 180px; height: 180px;
    border-radius: 50%; background: rgba(255,255,255,0.03);
    bottom: -80px; left: 60px;
}
.page-hero-content { position: relative; z-index: 1; }
.page-hero h2 {
    font-size: 22px; font-weight: 700; color: #fff;
    margin: 0 0 6px; letter-spacing: -0.02em;
}
.page-hero p { font-size: 14px; opacity: 0.85; margin: 0; }
.page-hero-stats { display: flex; gap: 32px; margin-top: 20px; flex-wrap: wrap; }
.page-hero-stat { text-align: left; }
.page-hero-stat-num {
    font-size: 26px; font-weight: 700; color: #fff;
    line-height: 1; display: block; font-variant-numeric: tabular-nums;
}
.page-hero-stat-label { font-size: 12px; opacity: 0.75; margin-top: 2px; }

/* === P2: 统一标签页组件 === */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--gray-200); padding: 0; }
.tabs-tab {
    padding: var(--space-3) var(--space-4); font-size: 14px; font-weight: 500;
    color: var(--gray-500); cursor: pointer; border: none; background: none;
    position: relative; transition: color var(--ease-std);
    white-space: nowrap;
}
.tabs-tab::after {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
    height: 2px; background: var(--red-primary); transform: scaleX(0);
    transition: transform var(--ease-std);
}
.tabs-tab:hover { color: var(--gray-700); }
.tabs-tab.active { color: var(--red-primary); font-weight: 600; }
.tabs-tab.active::after { transform: scaleX(1); }
.tabs-tab .badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    background: var(--gray-200); color: var(--gray-600); font-size: 11px;
    font-weight: 600; margin-left: 6px;
}
.tabs-tab.active .badge { background: var(--red-light); color: var(--red-primary); }

/* === P2: 统一交互卡片基类 === */
.card-interactive {
    background: var(--bg-card); border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg); padding: var(--space-5);
    transition: all var(--ease-std); cursor: pointer;
}
.card-interactive:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.card-interactive:active { transform: translateY(0) scale(0.99); }

/* === P2: 统一 stat-card === */
.stat-card {
    background: var(--bg-card); border-radius: var(--radius-lg);
    padding: var(--space-5); border-left: 3px solid var(--red-primary);
    transition: all var(--ease-std);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card-label { font-size: 12px; color: var(--gray-500); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-2); }
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--gray-800); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* === P3: 微妙纹理（噪点覆盖） === */
body::after {
    content: ''; position: fixed; inset: 0; z-index: -1;
    pointer-events: none; opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* === P3: 导航活跃态增强 === */
.nav a.active {
    font-weight: 600;
    position: relative;
}

/* === P3: 按钮层次统一 === */
.btn-primary, .btn-success, .btn-danger {
    letter-spacing: 0.01em;
    font-weight: 500;
}
