/* --- 极光紫主题 (Aurora Purple Theme v3 - Compact Matrix) --- */
:root {
  --bg-sidebar: #FFFFFF;
  --bg-card: #FFFFFF;
  
  /* 极光紫核心色板 */
  --primary: #7C3AED;
  --primary-hover: #6D28D9;
  --primary-light: #F3E8FF;
  --text-main: #1F2937;
  --text-sub: #6B7280;
  --border: #F3F4F6;
  --sidebar-width: 260px;
  
  --gradient-brand: linear-gradient(135deg, #6366F1 0%, #A855F7 100%);
  --bg-body: #FBFBFF;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  overflow: hidden;
  line-height: 1.6;
}

/* --- 左侧侧边栏 --- */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}

.logo {
  font-family: 'Great Vibes', cursive;
  font-size: 3rem;
  margin-bottom: 60px;
  text-decoration: none;
  line-height: 1;
  display: inline-block;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-menu { display: flex; flex-direction: column; gap: 12px; }

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-sub);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: #FAFAFA;
  color: var(--text-main);
}

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

.sidebar-footer {
  margin-top: auto;
  font-size: 0.75rem;
  color: #D1D5DB;
  text-align: center;
}

/* --- 右侧内容区 (加宽以容纳矩阵) --- */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 40px; /* 减小外边距 */
}

.content-wrapper {
  max-width: 1200px; /* 加宽到 1200px */
  margin: 0 auto;
}

/* --- 白色卡片容器 (紧凑版) --- */
.card-box {
  background: var(--bg-card);
  padding: 32px 24px; /* 减小内边距 */
  border-radius: 20px;
  box-shadow: 0 10px 40px -10px rgba(124, 58, 237, 0.05); 
  margin-bottom: 30px;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* --- 页面标题 (无背景风格) --- */
.page-header {
  margin-bottom: 30px;
  padding-left: 8px;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-main);
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.page-header p {
  font-size: 1.1rem;
  color: var(--text-sub);
  margin: 0;
}

/* --- 量化矩阵表格 (Matrix Table - 一屏全显版) --- */
.matrix-container {
  overflow-x: hidden; /* 尝试隐藏滚动条，强制一屏 */
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* 固定布局 */
}

.matrix-table th, 
.matrix-table td {
  padding: 8px 2px; /* 极致压缩内边距 */
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem; /* 约 13px */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 日期列 */
.matrix-table th:first-child,
.matrix-table td:first-child {
  width: 90px;
  background-color: #FAFAFA;
  font-weight: 600;
  color: var(--text-main);
  border-right: 1px solid var(--border);
}

/* 策略列 (a01-a10) */
.matrix-table th:not(:first-child),
.matrix-table td:not(:first-child) {
  /* 自动平分剩余空间 */
}

.matrix-table th {
  background-color: #F9FAFB;
  font-weight: 600;
  color: var(--text-sub);
}

/* 紧凑型 Badge */
.mini-badge {
  display: inline-block;
  padding: 2px 0;
  width: 100%;
  max-width: 50px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}

.mini-buy { background: #FEE2E2; color: #991B1B; } /* 涨 */
.mini-sell { background: #DCFCE7; color: #166534; } /* 跌 */
.mini-hold { background: #DBEAFE; color: #1E40AF; }
.mini-wait { background: #F3F4F6; color: #9CA3AF; }

/* 策略选择区 (紧凑) */
.strategy-filter { margin-bottom: 24px; }

.strategy-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px; /* 间距缩小 */
  align-items: center;
}

.chip {
  padding: 6px 12px;
  background-color: #F3F4F6;
  color: var(--text-sub);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.chip:hover {
  background-color: #E5E7EB;
  color: var(--text-main);
}

.chip.active {
  background-color: var(--primary);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

/* --- 其他通用样式保留 --- */
.main-content h1 { font-size: 2.5rem; font-weight: 800; margin: 0 0 16px 0; color: var(--text-main); }
.main-content h2 { font-size: 1.5rem; font-weight: 700; margin: 30px 0 20px; color: var(--text-main); }
.main-content p { font-size: 1.1rem; color: #4B5563; margin-bottom: 24px; }
.main-content a { color: var(--primary); text-decoration: none; }

/* 博客列表 */
.blog-header { display: flex; align-items: center; margin-bottom: 40px; padding-bottom: 20px; border-bottom: 1px solid rgba(0,0,0,0.05); }
.blog-title { font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif; font-size: 3rem; font-weight: 900; margin: 0; line-height: 1.2; background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; }
.blog-header .subtitle { font-size: 1.1rem; color: var(--text-sub); margin-top: 8px; font-weight: 400; letter-spacing: 1px; }

.article-list { display: flex; flex-direction: column; }
.article-item { display: flex; flex-direction: column; padding: 24px 0; border-bottom: 1px solid var(--border); text-decoration: none !important; transition: all 0.2s ease; }
.article-item:hover { background: #FAFAFA; padding-left: 20px; padding-right: 20px; border-radius: 12px; border-bottom-color: transparent; transform: translateY(-2px); }
.article-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.article-title { font-size: 1.2rem; font-weight: 600; color: var(--text-main); }
.article-item:hover .article-title { color: var(--primary); }
.article-meta { display: flex; align-items: center; gap: 12px; font-size: 0.85rem; color: var(--text-sub); }

.tag { display: inline-block; padding: 2px 10px; background: #F3F4F6; color: var(--text-sub); border-radius: 20px; font-size: 0.75rem; font-weight: 500; }
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-purple { background: #FAE8FF; color: #D946EF; }

.profile-header { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--gradient-brand); padding: 3px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background-color: #FFFFFF; }
.brand-highlight { background: var(--primary-light); color: var(--primary); padding: 2px 8px; border-radius: 6px; font-weight: 600; font-size: 0.9em; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--border); }
.stat-card .number { display: block; font-size: 2rem; font-weight: 800; color: var(--text-main); line-height: 1; margin-bottom: 6px; }
.stat-card .label { font-size: 0.9rem; color: var(--text-sub); font-weight: 500; }

/* --- 登录弹窗 (Modal) --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: #fff;
  padding: 32px;
  border-radius: 16px;
  width: 360px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

/* --- 顶部用户栏 --- */
.user-bar {
  position: absolute;
  top: 24px;
  right: 40px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-login {
  padding: 8px 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-login:hover { background: var(--primary-hover); }

.user-info {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 500;
  display: none; /* 默认隐藏，JS 控制显示 */
}

/* --- 锁定状态标签 --- */
.chip.locked {
  background-color: #F3F4F6;
  color: #9CA3AF;
  cursor: not-allowed;
}

.chip.locked.active {
  background-color: #E5E7EB;
  color: #6B7280;
  box-shadow: none;
  border: 1px solid #D1D5DB;
}

/* --- 无权限遮罩 --- */
.access-denied-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  background: #fff;
  border-radius: 12px;
  text-align: center;
}

.lock-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

/* --- 汉堡菜单按钮 (默认隐藏) --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001; /* 确保在最顶层 */
}

.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text-main);
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* 汉堡按钮激活状态 (变为X) */
.hamburger.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* --- 手机端适配 --- */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    overflow: auto;
    height: auto;
  }
  
  /* 顶部导航栏容器 */
  .sidebar {
    width: 100%;
    height: 60px;
    padding: 0 20px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 10px rgba(0,0,0,0.05);
  }
  
  .logo {
    font-size: 1.8rem;
    margin-bottom: 0;
  }
  
  /* 显示汉堡按钮 */
  .hamburger {
    display: flex;
  }

  /* 移动端全屏菜单 (默认隐藏) */
  .nav-menu {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: #fff;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 30px;
    transform: translateX(100%); /* 默认移出屏幕 */
    transition: transform 0.3s ease-in-out;
    z-index: 998;
  }

  /* 激活菜单 (滑入) */
  .nav-menu.active {
    transform: translateX(0);
  }
  
  .nav-item {
    font-size: 1.2rem;
    padding: 15px 30px;
    width: 100%;
    text-align: center;
    background: #F9FAFB;
  }
  
  .sidebar-footer {
    display: none;
  }
  
  /* 内容区域下移，避开固定顶部栏 */
  .main-content {
    margin-top: 60px;
    padding: 20px 15px;
  }
  
  /* 顶部用户栏 (移动到菜单内或调整位置，这里暂时隐藏，避免重叠) */
  .user-bar {
    display: none; 
  }
  
  .content-wrapper {
    padding: 0;
  }
  
  .card-box {
    padding: 24px 20px;
    margin-bottom: 20px;
  }
  
  /* 个人信息头 */
  .profile-header {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  /* 描述文本左对齐优化 */
  .profile-header + p {
    text-align: left;
    padding: 0 10px;
    font-size: 1rem;
    line-height: 1.7;
  }
  
  .avatar img {
    width: 100px;
    height: 100px;
  }
  
  /* 统计栏：水平排列 (Flex Row) */
  .stats-grid {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
  }

  .stat-card {
    text-align: center;
    flex: 1;
  }

  .stat-card .number {
    font-size: 1.5rem;
  }

  .stat-card .label {
    font-size: 0.8rem;
  }
  
  /* 文章列表 */
  .article-item {
    padding: 15px 0;
  }
  
  .article-header {
    flex-direction: column;
    gap: 5px;
  }

  .article-meta {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* 博客标签移动端 */
  .strategy-filter {
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
  }
  
  .strategy-tags {
    flex-wrap: nowrap;
    gap: 10px;
  }

  .chip {
    white-space: nowrap;
  }
  
  /* 弹窗适配 */
  .modal-content {
    width: 90%;
    padding: 25px;
  }
}

/* 更小屏幕微调 */
@media (max-width: 480px) {
  .logo {
    font-size: 1.5rem;
  }
}
