:root {
    --page-max: 1280px;
    --side-w: 240px;
    --gap: 20px;
    --cols: 3;

    --font-ui: "Inter", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --bg: #f5f6f8;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: rgba(0, 0, 0, .08);

    --shadow-soft: 0 6px 18px rgba(0, 0, 0, .10), 0 1px 4px rgba(0, 0, 0, .06);
    --shadow-strong: 0 12px 36px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .08);

    --radius: 16px;
  }

  html[data-theme="dark"] {
    --bg: #0b0c0f;
    --panel: #0f1115;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: rgba(255, 255, 255, .12);
  }

  @media (prefers-color-scheme: dark) {
    html[data-theme="system"] {
      --bg: #0b0c0f;
      --panel: #0f1115;
      --text: #e5e7eb;
      --muted: #94a3b8;
      --border: rgba(255, 255, 255, .12);
    }
  }

  * {
    box-sizing: border-box
  }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
  }

  a {
    color: inherit;
    text-decoration: none
  }

  .container {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 16px
  }

  .topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap
  }

  .search {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 14px;
    box-shadow: var(--shadow-soft);
    min-width: 260px
  }

  .search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 14px
  }

  .btn {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    font-size: 12px;
    cursor: pointer
  }

  .ctrl {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    font-size: 12px
  }

  .ctrl input[type="range"] {
    width: 120px
  }

  .pills {
    display: flex;
    gap: 10px;
    overflow: auto;
    padding: 10px 2px 12px;
    margin-bottom: 14px
  }

  .pill {
    white-space: nowrap;
    background: #eef2ff;
    color: #2d3a8c;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    box-shadow: var(--shadow-soft)
  }

  .pill.active {
    background: #1e40af;
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-strong)
  }

  .layout {
    display: grid;
    grid-template-columns: var(--side-w) 1fr;
    gap: var(--gap)
  }

  @media (max-width: 1024px) {
    :root {
      --cols: 2;
      --side-w: 220px;
    }
  }

  @media (max-width: 860px) {
    .layout {
      grid-template-columns: 1fr
    }

    .sidebar {
      order: 2
    }

    .content {
      order: 1
    }
  }

  @media (max-width: 640px) {
    :root {
      --cols: 1;
    }
  }

  .sidebar {
    position: relative
  }

  .panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    padding: 10px 0;
    margin-bottom: 10px
  }

  .panel h3 {
    margin: 0;
    padding: 10px 14px;
    font-size: 14px
  }

  .section {
    border-top: 1px solid var(--border)
  }

  .section summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 14px;
    font-weight: 600;
    color: var(--text)
  }

  .section summary::-webkit-details-marker {
    display: none
  }

  .section .body {
    padding: 8px 14px 12px;
    color: var(--muted);
    display: grid;
    gap: 8px
  }

  .section label {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    cursor: pointer
  }

  .section input[type="checkbox"],
  .section input[type="radio"] {
    accent-color: #2563eb
  }

  .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px
  }

  .chip {
    background: #eef2ff;
    color: #2d3a8c;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 12px;
    box-shadow: var(--shadow-soft)
  }

  .chip button {
    all: unset;
    cursor: pointer;
    margin-left: 6px
  }

  .swatches {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
  }

  .swatch {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid rgba(0, 0, 0, .15);
    box-sizing: content-box;
    cursor: pointer;
    box-shadow: var(--shadow-soft)
  }

  html[data-theme="dark"] .swatch {
    border-color: rgba(255, 255, 255, .22)
  }

  .swatch.selected {
    outline: 2px solid #2563eb
  }

  .content .stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 2px 12px;
    color: var(--muted);
    font-size: 13px
  }

  .grid {
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: 16px
  }

  /* 卡片：4px 撞色边框 + 玻璃层 + 柔和阴影 + 左上文案 */
  .card {
    --bg0: #4050F0;
    --accent: #FF9800;
    background: var(--bg0);
    color: #fff;
    border-radius: var(--radius);
    border: 4px solid #999;
    box-shadow: var(--shadow-strong);
    overflow: hidden;
    position: relative;
    min-height: 210px;
  }

  .card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: calc(var(--radius) - 4px);
    pointer-events: none;
  }

  .card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: calc(var(--radius) - 4px);
    pointer-events: none;
  }

  .card>* {
    position: relative;
    z-index: 1;
  }

  .card .top {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    padding: 12px 12px 8px;
    min-height: 88px;
  }

  .card h4 {
    margin: 0 0 6px 0;
    font-size: 14px;
    line-height: 1.25;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .30), 0 1px 2px rgba(0, 0, 0, .28)
  }

  .desc {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    max-width: 88%;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .28), 0 1px 2px rgba(0, 0, 0, .25)
  }

  .card .meta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    align-items: center;
    padding: 10px 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .30), 0 1px 2px rgba(0, 0, 0, .28);
  }

  /* 可点击卡片的悬停效果 */
  .card.clickable {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

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

  .card.clickable:active {
    transform: translateY(0);
  }

  /* 9色主题 + 撞色边框映射 */
  .c-red {
    --bg0: #F80030;
    --accent: #4050F0;
  }

  .c-blue {
    --bg0: #4050F0;
    --accent: #FF9800;
  }

  .c-green {
    --bg0: #78C840;
    --accent: #FF5E29;
  }

  .c-orange {
    --bg0: #FF9800;
    --accent: #4050F0;
  }

  .c-yellow {
    --bg0: #FFD000;
    --accent: #00804A;
  }

  .c-deepgreen {
    --bg0: #00804A;
    --accent: #FFB6EF;
  }

  .c-pink {
    --bg0: #FFB6EF;
    --accent: #00804A;
  }

  .c-orange2 {
    --bg0: #FF5E29;
    --accent: #4050F0;
  }

  .c-yellow2 {
    --bg0: #FFD12E;
    --accent: #F80030;
  }

  .glass-off .card::before,
  .glass-off .card::after {
    display: none;
  }

  /* 模态框样式 */
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
  }

  .modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--panel);
    border-radius: 0;
    overflow: hidden;
  }

  .modal-close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.9);
  }

  .modal-close-btn svg {
    width: 24px;
    height: 24px;
  }

  #featureIframe {
    width: 100%;
    height: 100%;
    border: none;
  }