/* ===== 变量 ===== */
:root {
    --bg: #f7f8fa;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --radius: 14px;
  }
  
  body.dark {
    --bg: #0f172a;
    --panel: #111827;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: #1f2937;
  }
  
  /* ===== 基础 ===== */
  * {
    box-sizing: border-box;
    font-family: system-ui, -apple-system;
  }
  
  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
  }
  
  /* ===== Header ===== */
  .header {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
  }
  
  .header-row {
    display: flex;
    align-items: center;
    padding: 8px 14px;
  }
  
  .header-row.top {
    gap: 10px;
  }
  
  .header-row.bottom {
    padding-top: 0;
  }
  
  .header h1 {
    font-size: 16px;
    margin-right: auto;
  }
  
  .menu-btn {
    font-size: 18px;
    border: none;
    background: none;
    display: none;
  }
  
  .status-bar {
    font-size: 12px;
    padding: 6px 14px;
    color: var(--muted);
  }
  
  /* ===== 搜索 ===== */
  .search-wrapper {
    position: relative;
    width: 100%;
  }
  
  .search-wrapper input {
    width: 100%;
    padding: 8px 30px 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
  }
  
  .search-wrapper button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    border: none;
    background: none;
  }
  
  /* ===== 布局 ===== */
  .layout {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
  }
  
  /* Sidebar */
  .sidebar {
    width: 200px;
    padding: 0px;
    background: color-mix(in srgb, var(--panel) 96%, var(--bg));
    border-right: 1px solid var(--border);
  }
  .sidebar ul {
    padding: 10px;
  }
  
  .sidebar li {
    list-style: none;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--muted);
  }
  
  .sidebar li.active {
    background: var(--panel);
    color: var(--text);
  }
  
  /* 主内容 */
  .main {
    flex: 1;
    padding: 16px;
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
  }
  
  /* 卡片 */
  .card {
    position: relative;
    background: var(--panel);
    padding: 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: box-shadow .2s, transform .2s;
  }
  
  .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
  }
  
  .card h3 {
    margin: 0 0 6px;
    font-size: 15px;
  }
  
  .arrow {
    position: absolute;
    right: 12px;
    bottom: 12px;
    font-size: 14px;
    color: var(--muted);
  }
  
  .meta {
    font-size: 12px;
    color: var(--muted);
  }
  
  /* 空状态 */
  .empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 10px;
    color: var(--muted);
  }
  
  /* ===== 详情页 ===== */
  .detail-header {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
  }
  
  .detail-page iframe {
    width: 100vw;
    height: calc(100vh - 44px);
    border: none;
  }
  
  .loading {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--muted);
  }
  
  /* ===== Overlay ===== */
  .overlay {
    display: none;
  }
  .overlay.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
  }
  
  /* ===== 移动端 ===== */
  @media (max-width: 768px) {
    .menu-btn {
      display: block;
    }
  
    .layout {
      flex-direction: column;
    }
  
    .sidebar {
      position: fixed;
      top: 0;
      left: -220px;
      height: 100%;
      z-index: 20;
      transition: left .25s;
    }
  
    .sidebar.open {
      left: 0;
    }
  
    .main {
      grid-template-columns: 1fr;
    }
  }
  