/* 基础-UI风格：简约、扁平、易读 */
:root {
  --bg: #FFFFFF;
  --text: #111111;
  --muted: #666666;
  --brand: #8B0000; /* ZAFT 红 */
  --brand-hover: #B22222;
  --green: #3A5F3D; /* 军绿 */
  --gray: #A9A9A9; /* 舰体灰 */
  --hud-green: #00B37A;
  --warn: #FFD700;
  --error: #FF4500;
  --table-header: #F2F2F2; /* 舰体灰淡化 */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', sans-serif; }

.topbar { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 12px 16px; 
  border-bottom: 1px solid rgba(169, 169, 169, 0.3); 
  background: rgba(255, 255, 255, 0.6); 
  backdrop-filter: blur(10px); 
  -webkit-backdrop-filter: blur(10px); 
  position: sticky; 
  top: 0; 
  z-index: 10; 
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}
.brand { font-weight: 700; }

/* 汉堡菜单按钮 */
.menu-toggle { display: none; flex-direction: column; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger { width: 25px; height: 3px; background: var(--text); margin: 3px 0; transition: 0.3s; border-radius: 2px; }
.menu-toggle.active .hamburger:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); }
.menu-toggle.active .hamburger:nth-child(2) { opacity: 0; }
.menu-toggle.active .hamburger:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); }

/* 导航菜单 */
.topnav { display: flex; align-items: center; }
.topnav .navlink { margin-left: 12px; text-decoration: none; color: var(--text); padding: 6px 8px; border-radius: 4px; }
.topnav .navlink:hover { background: var(--table-header); }

.container { padding: 16px; }

/* 页面标题 */
.page-title { font-size: 24px; font-weight: 700; margin: 0; color: var(--text); }
.text-muted { color: var(--muted); }

/* 按钮系统 */
.btn { 
  display: inline-flex; 
  align-items: center; 
  gap: 6px;
  border: 1px solid var(--gray); 
  background: #fff; 
  color: var(--text); 
  padding: 10px 16px; 
  border-radius: 8px; 
  text-decoration: none; 
  cursor: pointer; 
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.btn-primary { 
  background: var(--brand); 
  color: #fff; 
}
.btn-primary:hover { 
  background: var(--brand-hover); 
}

.btn-secondary { 
  border: 1px solid var(--green); 
  color: var(--green); 
  background: #fff; 
}
.btn-secondary:hover { 
  background: var(--green); 
  color: #fff; 
}

.btn-warning { 
  background: var(--warn); 
  color: #000; 
}
.btn-warning:hover { 
  background: #FFA500; 
}

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

.btn-icon { 
  font-size: 16px; 
  font-weight: bold; 
}

.form { display: flex; flex-direction: column; gap: 10px; }
.form input[type="text"], .form input[type="password"], .form input[type="email"], .form .input, .form select { padding: 10px; border: 1px solid var(--gray); border-radius: 6px; }
.form-actions { display: flex; gap: 8px; margin-top: 8px; }
.form-check { display: flex; align-items: center; gap: 8px; color: var(--muted); }

.flash { list-style: none; padding: 0; margin: 0 0 12px; }
.flash li { padding: 10px; border-radius: 6px; margin-bottom: 8px; }
.flash .success { background: #EAF1EC; color: var(--green); }
.flash .error { background: #FFE8E5; color: var(--error); }

/* 动态消息提示样式 */
.message-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 400px;
}

.message {
  position: relative;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease-out;
  font-size: 14px;
  line-height: 1.4;
}

.message-success {
  background: #EAF1EC;
  color: var(--green);
  border-left: 4px solid var(--green);
}

.message-error {
  background: #FFE8E5;
  color: var(--error);
  border-left: 4px solid var(--error);
}

.message-info {
  background: #E3F2FD;
  color: #1976D2;
  border-left: 4px solid #1976D2;
}

.message-warning {
  background: #FFF3E0;
  color: #F57C00;
  border-left: 4px solid #F57C00;
}

.message-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-close:hover {
  opacity: 1;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
.field-error { color: var(--error); font-size: 12px; margin-top: 4px; }

.dashboard .cards { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 16px; 
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

@media (min-width: 1200px) {
  .dashboard-header {
    margin-bottom: 24px;
  }
}

.dashboard-header .title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.dashboard-base-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-base-select {
  min-width: 200px;
  padding: 8px 10px;
  border: 1px solid var(--gray);
  border-radius: 6px;
}

.dashboard-base-message {
  font-size: 13px;
  color: var(--muted);
}

.dashboard-base-message.is-error {
  color: var(--error);
}

.dashboard-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--gray);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-meta {
  font-size: 13px;
  color: var(--muted);
}

.dashboard-footer-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.dashboard-user-info {
  font-size: 13px;
  color: var(--muted);
}

.card { 
  border: 1px solid var(--gray); 
  border-radius: 12px; 
  padding: 20px; 
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.2s ease;
  min-width: 0;
  width: 100%;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

/* 仪表盘入场翻转动画（沿Y轴，从左向右翻开） */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title { 
  font-weight: 600; 
  font-size: 16px;
  color: var(--text); 
  margin: 0;
}

.card-icon {
  font-size: 24px;
  opacity: 0.7;
}

.card-body {
  padding: 0;
}

.card-bbs .card-body {
  padding: 0;
}

.bbs-latest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bbs-latest-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.bbs-latest-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.bbs-latest-title {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bbs-latest-meta {
  display: block;
  flex: 0 1 120px;
  min-width: 0;
  max-width: 120px;
  font-size: 12px;
  color: #1E88E5;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 图片仪表：等比缩放、不变形，圆角与卡片统一 */
.image-gauge {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  position: relative; /* 供流光覆盖层定位 */
}

.image-gauge-img {
  display: block;
  width: 100%;
  height: auto; /* 关键：保持比例 */
  object-fit: contain; /* 防止裁剪，确保不变形 */
}

/* 轻微流光：节日氛围（不过度） */
.image-gauge::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 50%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(120deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.22) 50%,
    rgba(255,255,255,0) 100%
  );
  transform: skewX(-18deg);
  opacity: 0;
  animation: shimmer-sweep 6s ease-in-out infinite;
}

@keyframes shimmer-sweep {
  0% { left: -60%; opacity: 0; }
  10% { opacity: 0.5; }
  50% { left: 110%; opacity: 0.18; }
  100% { left: 110%; opacity: 0; }
}

/* 轻柔金色光晕：极低强度，避免夸张 */
.image-gauge {
  box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.0);
  animation: soft-glow 10s ease-in-out infinite;
}

@keyframes soft-glow {
  0%, 100% { box-shadow: 0 0 6px 0 rgba(255, 215, 0, 0.06); }
  50% { box-shadow: 0 0 12px 0 rgba(255, 215, 0, 0.10); }
}

.main-data {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--table-header);
}

.main-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 8px;
  line-height: 1;
}

.main-label {
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
}

.sub-data {
  display: flex;
  justify-content: space-around;
  gap: 20px;
}

.sub-item {
  text-align: center;
  flex: 1;
}

.sub-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1;
}

.sub-value.positive {
  color: var(--hud-green);
}

.sub-value.negative {
  color: var(--error);
}

.sub-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* 页面布局 */
.page-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 24px; 
  padding-bottom: 16px; 
  border-bottom: 1px solid var(--table-header); 
}

/* 筛选器 */
.filter-bar { 
  margin-bottom: 20px; 
  padding: 16px; 
  background: var(--table-header); 
  border-radius: 8px; 
}

.filter-form { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
}

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

.filter-label { 
  font-weight: 500; 
  color: var(--text); 
}

.filter-select { 
  padding: 8px 12px; 
  border: 1px solid var(--gray); 
  border-radius: 6px; 
  background: #fff; 
  font-size: 14px; 
}

/* 数据表格 */
.table-container { 
  background: #fff; 
  border-radius: 8px; 
  overflow: hidden; 
  box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
}

.data-table { 
  width: 100%; 
  border-collapse: collapse; 
}

.data-table th { 
  background: var(--table-header); 
  padding: 16px; 
  text-align: left; 
  font-weight: 600; 
  color: var(--text); 
  border-bottom: 1px solid var(--gray); 
}

.data-table td { 
  padding: 16px; 
  border-bottom: 1px solid var(--table-header); 
  vertical-align: middle; 
}

.table-row:hover { 
  background: #EAF1EC; 
}

/* 用户信息 */
.user-info { 
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
}

.user-name { 
  font-weight: 600; 
  color: var(--text); 
}

.user-nickname { 
  font-size: 12px; 
  color: var(--muted); 
}

/* 徽章系统 */
.role-badge, .status-badge { 
  display: inline-block; 
  padding: 4px 8px; 
  border-radius: 4px; 
  font-size: 12px; 
  font-weight: 500; 
}

.role-badge { 
  background: var(--table-header); 
  color: var(--text); 
}

.role-gicho { 
  background: var(--brand); 
  color: #fff; 
}

.role-kancho { 
  background: var(--green); 
  color: #fff; 
}

.status-badge { 
  background: var(--table-header); 
  color: var(--text); 
}

.status-active { 
  background: var(--hud-green); 
  color: #fff; 
}

.status-inactive { 
  background: var(--error); 
  color: #fff; 
}

/* 操作按钮 */
.action-buttons { 
  display: flex; 
  gap: 8px; 
}

.action-form { 
  margin: 0; 
}

/* 空状态 */
.empty-state { 
  text-align: center; 
  padding: 60px 20px; 
  color: var(--muted); 
}

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

.empty-title { 
  font-size: 18px; 
  font-weight: 600; 
  margin-bottom: 8px; 
  color: var(--text); 
}

.empty-description { 
  font-size: 14px; 
  color: var(--muted); 
}

/* 旧样式保留（向后兼容） */
.list { list-style: none; padding: 0; margin: 0; }
.list-item { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--table-header); padding: 12px 0; }
.list-item .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.list .empty { color: var(--muted); text-align: center; padding: 20px 0; }

/* 用户卡片布局 */
.user-cards { 
  display: block; 
}

.user-card { 
  display: block;
  background: #fff; 
  border-radius: 8px; 
  padding: 16px; 
  margin-bottom: 12px; 
  box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
  border: 1px solid var(--table-header); 
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  cursor: pointer;
}

.user-card:hover { 
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
  transform: translateY(-2px);
  border-color: var(--zaft-red);
}

.user-card:active { 
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.user-card .card-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: flex-start; 
  margin-bottom: 12px; 
}

.user-card .user-info { 
  flex: 1; 
}

.user-card .user-badges { 
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
  align-items: flex-end; 
}

.user-card .card-footer { 
  border-top: 1px solid var(--table-header); 
  padding-top: 12px; 
  text-align: right; 
}

.card-arrow { 
  color: var(--muted); 
  font-size: 18px; 
  font-weight: bold;
  transition: color 0.2s ease;
}

.user-card:hover .card-arrow { 
  color: var(--zaft-red); 
}

/* 用户详情页面 */
.user-detail { 
  max-width: 800px; 
  margin: 0 auto; 
}

.back-nav { 
  margin-bottom: 20px; 
}

.user-info-card { 
  background: #fff; 
  border-radius: 8px; 
  padding: 20px; 
  margin-bottom: 20px; 
  box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
  border: 1px solid var(--table-header); 
}

.user-info-card .card-header { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
  margin-bottom: 20px; 
}

.user-avatar { 
  width: 60px; 
  height: 60px; 
  border-radius: 50%; 
  background: var(--table-header); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
}

.avatar-icon { 
  font-size: 24px; 
  color: var(--muted); 
}

.user-main-info { 
  flex: 1; 
}

.user-main-info .user-name { 
  font-size: 24px; 
  font-weight: 700; 
  margin-bottom: 4px; 
}

.user-main-info .user-nickname { 
  color: var(--muted); 
  margin-bottom: 8px; 
}

.user-main-info .user-badges { 
  display: flex; 
  gap: 8px; 
}

.info-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
  gap: 16px; 
}

.info-item { 
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
}

.info-label { 
  font-size: 12px; 
  color: var(--muted); 
  font-weight: 500; 
}

.info-value { 
  font-size: 14px; 
  color: var(--text); 
}

.action-section, .login-history { 
  background: #fff; 
  border-radius: 8px; 
  padding: 20px; 
  margin-bottom: 20px; 
  box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
  border: 1px solid var(--table-header); 
}

.section-title { 
  font-size: 18px; 
  font-weight: 600; 
  margin-bottom: 16px; 
  color: var(--text); 
}

.action-section .action-buttons { 
  display: flex; 
  gap: 12px; 
  flex-wrap: wrap; 
}

.history-card { 
  background: var(--table-header); 
  border-radius: 6px; 
  padding: 16px; 
}

.history-item { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 8px 0; 
  border-bottom: 1px solid var(--gray); 
}

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

.history-label { 
  font-size: 14px; 
  color: var(--muted); 
}

.history-value { 
  font-size: 14px; 
  color: var(--text); 
  font-weight: 500; 
}

/* 响应式布局 - 桌面端 */
@media (min-width: 768px) {
  .dashboard .cards {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
  }
  
  .sub-data {
    gap: 40px;
  }
  
  .sub-value {
    font-size: 24px;
  }
  
  .sub-label {
    font-size: 14px;
  }
}

/* 大屏幕优化 - 更宽的流式布局 */
@media (min-width: 1200px) {
  .dashboard .cards {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
  }
}

@media (min-width: 1600px) {
  .dashboard .cards {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 28px;
  }
}

/* iPhone和iPad样式 */
.menu-toggle { display: flex; }

.topnav { 
  position: fixed; 
  top: 60px; 
  left: -100%; 
  width: 100%; 
  height: calc(100vh - 60px); 
  background: var(--bg); 
  flex-direction: column; 
  align-items: stretch; 
  padding: 20px 0; 
  transition: left 0.3s ease; 
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  z-index: 100;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.topnav.active { left: 0; }

.topnav .navlink { 
  margin: 0; 
  padding: 16px 20px; 
  border-bottom: 1px solid var(--table-header); 
  text-align: left;
}

.topnav .navlink:hover { background: var(--table-header); }

/* 当菜单打开时禁止body滚动 */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.container { padding: 12px; }

/* 页面布局 */
.page-header { 
  flex-direction: column; 
  align-items: stretch; 
  gap: 16px; 
}

.page-title { 
  font-size: 20px; 
  text-align: center; 
}

/* 筛选器 */
.filter-bar { 
  padding: 12px; 
}

.filter-form { 
  flex-direction: column; 
  align-items: stretch; 
  gap: 12px; 
}

.filter-group { 
  flex-direction: column; 
  align-items: stretch; 
  gap: 4px; 
}

.filter-select { 
  width: 100%; 
}

/* 用户详情 */
.user-info-card .card-header { 
  flex-direction: column; 
  align-items: center; 
  text-align: center; 
}

.user-main-info .user-badges { 
  justify-content: center; 
}

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

.action-section .action-buttons { 
  flex-direction: column; 
}

.action-section .action-buttons .btn { 
  width: 100%; 
}

/* 认证页面样式 */
.auth {
  max-width: 400px;
  margin: 40px auto;
  padding: 32px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  border: 1px solid var(--table-header);
}

.auth .title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 32px;
  color: var(--text);
}

.auth .form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth .form label {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.auth .form .input {
  padding: 12px 16px;
  border: 2px solid var(--table-header);
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s ease;
}

.auth .form .input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.auth .form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.auth .form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.auth .form-actions {
  margin-top: 24px;
}

.auth .btn-primary {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth .btn-primary:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.3);
}

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

/* 移动端认证页面适配 */
@media (max-width: 768px) {
  .auth {
    margin: 20px;
    padding: 24px;
  }
  
  .auth .title {
    font-size: 24px;
    margin-bottom: 24px;
  }
  
  .auth .form {
    gap: 16px;
  }
  
  .auth .form .input {
    padding: 14px 16px;
    font-size: 16px; /* 防止iOS缩放 */
  }
}

/* 作战计划日历样式 */
.calendar-container {
  max-width: 1200px;
  margin: 0 auto;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.view-controls {
  display: flex;
  gap: 8px;
}

/* 月视图样式 */
.month-navigation,
.week-navigation,
.day-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.month-title,
.week-title,
.day-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.month-calendar {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--table-header);
}

.weekday {
  padding: 12px;
  text-align: center;
  font-weight: 600;
  color: var(--text);
  border-right: 1px solid #ddd;
}

.weekday:last-child {
  border-right: none;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #ddd;
}

.calendar-day {
  background: #fff;
  min-height: 80px;
  padding: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.calendar-day:hover {
  background: var(--table-header);
}

.calendar-day.today {
  background: rgba(139, 0, 0, 0.1);
  border: 2px solid var(--brand);
}

.calendar-day.empty {
  background: #f9f9f9;
  cursor: default;
}

.calendar-day.empty:hover {
  background: #f9f9f9;
}

.day-number {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

.day-count {
  font-size: 12px;
  color: var(--brand);
  font-weight: 500;
  margin-top: 4px;
}

/* 周视图样式 */
.week-calendar {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
}

.week-grid {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  gap: 1px;
  background: #ddd;
}

.week-day {
  background: #fff;
  padding: 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.week-day:hover {
  background: var(--table-header);
}

.week-day.today {
  background: rgba(139, 0, 0, 0.1);
  border: 2px solid var(--brand);
}

.day-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-right: 20px;
}

.day-name {
  font-weight: 600;
  color: var(--text);
}

.day-date {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.day-stats {
  display: flex;
  flex-direction: row;
  gap: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-number {
  font-weight: 600;
  color: var(--brand);
  font-size: 16px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
}

/* 周视图响应式设计 */
@media (max-width: 768px) {
  .week-day {
    padding: 12px;
    min-height: 70px;
  }
  
  .day-header {
    margin-right: 15px;
  }
  
  .day-stats {
    gap: 15px;
  }
  
  .day-date {
    font-size: 16px;
  }
  
  .stat-number {
    font-size: 14px;
  }
  
  .stat-label {
    font-size: 11px;
  }
}

/* 日视图样式 */
.day-calendar {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
}

/* 整体布局：左右两列 */
.calendar-layout {
  display: flex;
  height: 500px; /* 固定总高度 */
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

/* 左侧固定列 */
.fixed-column {
  width: 150px;
  flex-shrink: 0;
  border-right: 2px solid #ddd;
  background: #f9f9f9;
}

.area-labels {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.area-label {
  padding: 12px;
  font-weight: 600;
  color: var(--text);
  background: #f9f9f9;
  border-bottom: 1px solid #ddd;
  text-align: center;
  height: 60px; /* 固定高度，与timeline一致 */
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.no-data-label {
  padding: 40px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

/* 右侧滚动表格 */
.scrollable-table {
  flex: 1;
  overflow: hidden;
}

.day-grid {
  height: 100%;
  overflow: auto;
  min-width: 1050px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 1px;
  background: #ddd;
  position: relative;
  height: 60px; /* 固定高度，与area-label一致 */
  border-bottom: 1px solid #ddd;
  box-sizing: border-box;
}

.hour-slot {
  background: #fff;
  height: 100%; /* 占满父容器高度 */
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
  border: 1px solid #ddd;
}

.hour-slot:hover {
  background: var(--table-header);
}

.hour-slot.occupied {
  background: rgba(58, 95, 61, 0.1);
  border: 1px solid var(--green);
  z-index: 1;
}

.hour-slot.own-slot {
  background: rgba(139, 0, 0, 0.1);
  border: 1px solid var(--brand);
}

.slot-content {
  padding: 4px;
  font-size: 11px;
  line-height: 1.2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time-info {
  font-weight: bold;
  color: var(--primary);
  font-size: 12px;
  margin-bottom: 2px;
}

.pilot-info {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.time-info {
  color: var(--muted);
  font-size: 10px;
}

.no-data {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
}

/* 统一的加载状态样式 */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 4px solid var(--table-header);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  font-size: 14px;
}

/* 兼容性：保留原有的loading类 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--muted);
}

/* 日历移动端适配 */
@media (max-width: 768px) {
  .calendar-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .calendar-day {
    min-height: 60px;
    padding: 6px;
  }
  
  .week-day {
    min-height: 100px;
    padding: 12px;
  }
  
  .calendar-layout {
    height: 400px; /* 移动端减小高度 */
  }
  
  .fixed-column {
    width: 120px;
  }
  
  .area-label {
    height: 50px;
    font-size: 12px;
    padding: 8px;
  }
  
  .day-grid {
    min-width: 880px;
  }
  
  .timeline {
    height: 50px;
    min-width: 880px;
  }
  
  .time-slot {
    padding: 6px 2px;
    font-size: 10px;
  }
  
  .slot-content {
    font-size: 10px;
    padding: 2px;
  }
  
  .pilot-info {
    font-size: 9px;
  }
  
  .time-info {
    font-size: 8px;
  }
  
  /* 重构后的日视图移动端样式 */
  .area-header {
    width: 120px;
    font-size: 12px;
  }
  
  .area-cell {
    width: 120px;
    font-size: 12px;
    min-height: 50px;
  }
  
  .time-slots {
    min-width: 960px;
  }
  
  .timeline-grid {
    min-width: 960px;
    min-height: 50px;
  }
}

/* 重构后的日视图样式 */
.day-calendar {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
}

/* 时间标题行 */
.time-header-row {
  display: flex;
  background: var(--table-header);
  border-bottom: 2px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 1;
}

.area-header {
  width: 150px;
  flex-shrink: 0;
  padding: 12px;
  font-weight: 600;
  color: var(--text);
  border-right: 2px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 60px;
}

.time-header-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
}

.time-slots {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 1px;
  background: #ddd;
  min-width: 1200px; /* 24小时的最小宽度 */
}

.time-slot {
  padding: 12px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--table-header);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 数据行容器 */
.data-rows {
  /* 不设固定高度，允许页面自然滚动 */
}

.data-row {
  display: flex;
  border-bottom: 1px solid #ddd;
}

.area-cell {
  width: 150px;
  flex-shrink: 0;
  padding: 12px;
  font-weight: 600;
  color: var(--text);
  background: #f9f9f9;
  border-right: 2px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  box-sizing: border-box;
}

.content-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 1px;
  background: #ddd;
  min-width: 1200px; /* 与时间标题对齐 */
  min-height: 60px;
}

.time-slot-item {
  background: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
  border: 1px solid #ddd;
}

.time-slot-item.occupied {
  background: rgba(0, 123, 255, 0.1);
  border: 1px solid var(--primary);
}

.time-slot-item.own-slot {
  background: rgba(139, 0, 0, 0.1);
  border: 1px solid var(--brand);
}

.footbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--table-header);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 1;
}

/* =========================
   BBS 页面样式
   ========================= */
.bbs-page {
  margin-top: 20px;
}

.bbs-layout {
  display: flex;
  gap: 24px;
}

.bbs-sidebar {
  width: 260px;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bbs-search {
  display: flex;
  gap: 8px;
}

.bbs-search input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

.bbs-filter {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: #495057;
}

.bbs-filter label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bbs-filter select {
  padding: 6px 8px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

.bbs-board-list h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.bbs-board-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bbs-board-list li {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.bbs-board-list li:hover {
  background-color: #e9ecef;
}

.bbs-board-list li.active {
  background-color: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 600;
}

.bbs-main {
  flex: 1;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bbs-status-bar {
  min-height: 24px;
  color: #868e96;
  font-size: 14px;
}

.bbs-post-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bbs-post-card {
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 16px;
  background: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease;
  cursor: pointer;
}

.bbs-post-card:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.bbs-post-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.bbs-post-card .card-header .title {
  font-size: 18px;
  font-weight: 600;
  color: #212529;
}

.bbs-post-card .card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #868e96;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.bbs-post-card .card-actions {
  margin-top: 8px;
}

.bbs-post-card .card-actions .btn-link {
  padding: 0;
  font-size: 14px;
}

.bbs-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.bbs-pagination .page-info {
  font-size: 14px;
  color: #868e96;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  margin-left: 6px;
}

.tag-info {
  background: #e3f2fd;
  color: #0b7285;
}

.tag-warning {
  background: #fff3bf;
  color: #d9480f;
}

.tag-unread {
  background: #ffe2e0;
  color: #c92a2a;
  box-shadow: inset 0 0 0 1px rgba(201, 42, 42, 0.2);
  font-weight: 600;
}

.bbs-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.bbs-modal.hidden {
  display: none;
}

.bbs-modal-dialog {
  background: white;
  border-radius: 16px;
  width: min(900px, 90vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bbs-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 12px;
  border-bottom: 1px solid #f1f3f5;
}

.bbs-modal-header h2 {
  margin: 0;
}

.bbs-modal-close,
.bbs-editor-close {
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.bbs-modal-meta {
  padding: 0 24px;
  font-size: 14px;
  color: #495057;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bbs-modal-toolbar {
  padding: 12px 24px;
  border-bottom: 1px solid #f1f3f5;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.bbs-modal-message {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 12px;
}

.bbs-modal-message.error {
  background: #fff5f5;
  color: #c92a2a;
}

.bbs-modal-message.success {
  background: #e6fcf5;
  color: #0b7285;
}

.bbs-post-content {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.bbs-post-edit.hidden {
  display: none;
}

.bbs-post-edit .form-label {
  margin-top: 12px;
}

.bbs-post-edit .form-input,
.bbs-post-edit .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-size: 14px;
}

.bbs-post-edit .bbs-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.bbs-related-pilots {
  margin: 16px 0;
}

.bbs-related-actions {
  display: flex;
  gap: 12px;
}

.bbs-reply-item {
  border: 1px solid #f1f3f5;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
}

.bbs-reply-item.depth-1 {
  margin-left: 24px;
  background: #f8f9fa;
}

.bbs-reply-item.depth-2 {
  margin-left: 48px;
}

.reply-header {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: #495057;
  margin-bottom: 6px;
}

.reply-content {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.reply-edit-textarea {
  width: 100%;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  resize: vertical;
  margin: 4px 0 0;
}

.reply-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.reply-actions .btn-link {
  font-size: 13px;
  padding: 0;
}

.btn-compact {
  padding: 6px 12px;
  font-size: 13px;
}

.bbs-reply-editor {
  margin-top: 16px;
  border-top: 1px solid #f1f3f5;
  padding-top: 16px;
}

.bbs-reply-editor textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  resize: vertical;
}

.bbs-reply-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.bbs-reply-actions .hint {
  font-size: 13px;
  color: #495057;
}

.bbs-reply-actions .actions {
  display: flex;
  gap: 12px;
}

.bbs-editor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  z-index: 1000;
}

.bbs-editor.hidden {
  display: none;
}

.bbs-editor-dialog {
  width: min(680px, 90vw);
  max-height: 90vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bbs-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 12px;
  border-bottom: 1px solid #f1f3f5;
}

.bbs-editor-dialog form {
  padding: 16px 24px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bbs-editor-dialog .form-label {
  font-size: 14px;
  color: #495057;
}

.bbs-editor-dialog .form-input,
.bbs-editor-dialog .form-select,
.bbs-editor-dialog .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-size: 14px;
}

.bbs-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.modal-open {
  overflow: hidden;
}

@media (max-width: 992px) {
  .bbs-layout {
    flex-direction: column;
  }

  .bbs-sidebar {
    width: 100%;
    flex-direction: column;
  }

  .bbs-post-card .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
