/* ========================================
   武侠风格 - 亮色调 · 执剑天涯
   ======================================== */

:root {
  /* 亮色调主题 */
  --sky-light: #fefcf8;
  --sky-warm: #fef9f0;
  --sky-blue: #e8f4fc;
  --cloud-white: #ffffff;
  --cloud-shadow: rgba(139, 120, 88, 0.08);
  
  /* 金色系 */
  --gold: #b8860b;
  --gold-light: #d4a84b;
  --gold-pale: #f5e6c8;
  --gold-soft: #e8c97a;
  
  /* 山水青墨 */
  --ink-dark: #2c3e50;
  --ink-medium: #4a5568;
  --ink-light: #718096;
  --jade: #2d5a4a;
  --jade-light: #4a8b7f;
  --jade-pale: #e8f5f0;
  
  /* 边框 */
  --border-gold: rgba(184, 134, 11, 0.25);
  --border-light: rgba(0, 0, 0, 0.06);
  
  /* 阴影 */
  --shadow-soft: 0 4px 20px rgba(139, 120, 88, 0.1);
  --shadow-card: 0 8px 32px rgba(139, 120, 88, 0.12);
  --shadow-hover: 0 12px 40px rgba(139, 120, 88, 0.18);
  
  /* 文字 */
  --text-primary: #2c3e50;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  
  /* 字体 */
  --font-display: 'Noto Serif SC', 'Songti SC', serif;
}

/* 全局 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text-primary);
  background: var(--sky-warm);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ========================================
   天空背景
   ======================================== */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(232, 201, 122, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(74, 139, 127, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(184, 134, 11, 0.05) 0%, transparent 40%),
    linear-gradient(180deg, #fdfcfb 0%, #fef9f0 40%, #fefcf8 100%);
  z-index: 0;
  pointer-events: none;
}

/* 飘云动画 */
.clouds {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 400px;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  filter: blur(20px);
  animation: cloud-drift linear infinite;
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: inherit;
}

@keyframes cloud-drift {
  from { transform: translateX(-200px); }
  to { transform: translateX(calc(100vw + 200px)); }
}

/* 远山剪影 */
.mountains-far {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.06;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 200'%3E%3Cpath fill='%232c3e50' d='M0,200 L0,120 Q180,40 360,100 T720,80 T1080,60 T1440,90 L1440,200 Z'/%3E%3C/svg%3E") bottom center / cover no-repeat;
}

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

.login-box {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 48px 40px;
  width: 420px;
  box-shadow: var(--shadow-card);
  animation: box-rise 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

@keyframes box-rise {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 顶部装饰带 */
.login-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-light), var(--jade-light), var(--gold-light));
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--ink-dark);
  letter-spacing: 6px;
  margin-bottom: 8px;
  position: relative;
  display: inline-block;
}

.login-title::before,
.login-title::after {
  content: '剑';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--gold-light);
  opacity: 0.6;
}

.login-title::before {
  left: -40px;
}

.login-title::after {
  right: -40px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  letter-spacing: 2px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-medium);
  letter-spacing: 1px;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: var(--sky-warm);
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  font-size: 15px;
  color: var(--ink-dark);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  background: white;
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

/* 主按钮 */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(184, 134, 11, 0.35);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(184, 134, 11, 0.45);
}

.btn-primary:hover::before {
  left: 100%;
}

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

.error-msg {
  text-align: center;
  color: #c0392b;
  margin-top: 14px;
  font-size: 13px;
  min-height: 18px;
}

/* ========================================
   导航栏
   ======================================== */
.nav {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand h1 {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink-dark);
  letter-spacing: 3px;
}

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

.nav-link {
  padding: 8px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--ink-dark);
  background: rgba(184, 134, 11, 0.08);
}

.nav-link.active {
  color: var(--gold);
  background: var(--gold-pale);
  font-weight: 600;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--jade-light), var(--jade));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(45, 90, 74, 0.3);
}

/* ========================================
   页面内容
   ======================================== */
.dashboard {
  padding: 24px;
  position: relative;
  z-index: 10;
}

/* 欢迎横幅 */
.welcome-banner {
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.8));
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 32px 40px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  animation: banner-in 0.5s ease;
}

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

.welcome-banner::after {
  content: '执剑天涯';
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 72px;
  color: rgba(184, 134, 11, 0.06);
  letter-spacing: 8px;
  pointer-events: none;
  white-space: nowrap;
}

.welcome-banner h2 {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--ink-dark);
  margin-bottom: 6px;
}

.welcome-banner p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ========================================
   统计卡片
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
  animation: card-in 0.5s ease backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card:nth-child(1)::before { background: linear-gradient(90deg, var(--gold-light), transparent); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, var(--jade-light), transparent); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #e74c3c, transparent); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, #3498db, transparent); }

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

.stat-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--ink-dark);
  margin-bottom: 4px;
  font-family: 'DIN Alternate', 'Courier New', monospace;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ========================================
   功能卡片
   ======================================== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 28px 24px;
  text-decoration: none;
  color: var(--ink-dark);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.03), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-gold);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 16px;
}

.feature-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink-dark);
}

.feature-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========================================
   数据表格
   ======================================== */
.table-container {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
}

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

.data-table th {
  background: var(--sky-warm);
  padding: 14px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border-light);
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  font-size: 14px;
  color: var(--ink-dark);
}

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

.data-table tr:hover td {
  background: rgba(245, 230, 200, 0.2);
}

/* 状态标签 */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-online {
  background: var(--jade-pale);
  color: var(--jade);
}

.badge-pending {
  background: var(--gold-pale);
  color: var(--gold);
}

.badge-offline {
  background: #fee2e2;
  color: #dc2626;
}

/* ========================================
   工具栏
   ======================================== */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.search-input {
  flex: 1;
  max-width: 360px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-dark);
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
  background: white;
}

.filter-select {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-dark);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-select:focus {
  outline: none;
  border-color: var(--gold);
}

/* 按钮 */
.btn-secondary {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-medium);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: white;
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: var(--shadow-soft);
}

/* ========================================
   页面标题
   ======================================== */
.page-title {
  margin-bottom: 24px;
}

.page-title h1 {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--ink-dark);
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.page-title p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========================================
   快捷操作
   ======================================== */
.quick-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
  color: var(--ink-medium);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s ease;
}

.quick-btn:hover {
  background: white;
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

/* ========================================
   模态框
   ======================================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: modal-rise 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-rise {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink-dark);
}

.close {
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.close:hover {
  color: var(--ink-dark);
}

.modal-body {
  padding: 24px 28px;
}

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

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav { padding: 0 16px; }
  .nav-links { display: none; }
  .login-box { margin: 16px; padding: 32px 24px; width: auto; }
  .welcome-banner { padding: 24px; }
  .welcome-banner::after { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* ========================================
   活动列表
   ======================================== */
.activity-feed {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 20px 24px;
  margin-top: 24px;
  box-shadow: var(--shadow-soft);
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  transition: background 0.2s;
}

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

.activity-item:hover {
  background: rgba(245, 230, 200, 0.15);
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.activity-content strong {
  color: var(--ink-dark);
}

.activity-content p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 2px 0 0 0;
}

.activity-time {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ========================================
   加载动画
   ======================================== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
}