  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
    padding-bottom: 80px;
  }
  .container { max-width: 960px; margin: 0 auto; padding: 40px 20px; }
  h1 { font-size: 32px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.5px; }
  .subtitle { color: #86868b; font-size: 15px; margin-bottom: 32px; }

  .section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }
  .section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .form-row { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
  .form-group { flex: 1; min-width: 200px; }
  .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #424245;
    margin-bottom: 6px;
  }
  .form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    background: #fff;
    color: #1d1d1f;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
  }
  .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #0071e3;
  }
  .form-group input::placeholder, .form-group textarea::placeholder { color: #c4c4c4; }
  .form-group textarea { resize: vertical; }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #0071e3;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
  }
  .btn:hover { background: #0077ed; }
  .btn:disabled { background: #a1a1a6; cursor: not-allowed; }

  .filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
  }
  .filter-bar select {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    background: #fff;
    outline: none;
  }

  .styles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
  }
  .style-card {
    background: #fff;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    position: relative;
  }
  .style-card:hover { border-color: #0071e3; }
  .style-card.selected {
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
  }
  .style-card .tier {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
  }
  .tier.S { background: #fff3e0; color: #e65100; }
  .tier.A { background: #e3f2fd; color: #1565c0; }
  .tier.B { background: #f5f5f5; color: #616161; }
  .style-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    padding-right: 40px;
  }
  .style-card .meta {
    font-size: 12px;
    color: #86868b;
    margin-bottom: 8px;
  }
  .style-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .style-card .tag {
    font-size: 11px;
    padding: 3px 8px;
    background: #f5f5f7;
    border-radius: 4px;
    color: #424245;
  }
  .style-card .suit-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
  }
  .style-card .suit-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
  }
  .style-card .suit-tag.ok {
    background: #e8f5e9;
    color: #2e7d32;
  }
  .style-card .suit-tag.no {
    background: #fafafa;
    color: #9e9e9e;
    text-decoration: line-through;
  }

  .result-area {
    display: none;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }
  .result-area.show { display: block; }
  .result-area img {
    width: 100%;
    max-width: 512px;
    border-radius: 8px;
    display: block;
    margin-bottom: 16px;
  }
  .images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
  }
  .images-grid img {
    width: 100%;
    border-radius: 8px;
    display: block;
    margin-bottom: 0;
  }
  .result-area .prompt-box {
    background: #f5f5f7;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    color: #424245;
    white-space: pre-wrap;
    word-break: break-word;
    position: relative;
  }
  .result-area .prompt-box .prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }
  .result-area .prompt-box strong {
    color: #1d1d1f;
    font-size: 13px;
  }
  .copy-btn {
    font-size: 12px;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    color: #0071e3;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
  }
  .copy-btn:hover {
    background: #f0f7ff;
    border-color: #0071e3;
  }
  .copy-btn.copied {
    color: #2e7d32;
    border-color: #2e7d32;
    background: #e8f5e9;
  }

  .history-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s;
  }
  .history-card:hover { transform: scale(1.02); }
  .history-card img {
    width: 100%;
    border-radius: 8px;
    display: block;
  }
  .history-card .meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: #fff;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.15s;
  }
  .history-card:hover .meta { opacity: 1; }

  /* Node Mode · 分支状态横幅 */
  .branch-banner {
    background: linear-gradient(90deg, #fff8e1, #ffebcc);
    border: 1px solid #ffb74d;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #6d4c00;
  }
  .branch-banner.show { display: flex; }
  .branch-banner img {
    width: 50px; height: 50px; object-fit: cover;
    border-radius: 6px; border: 1px solid #ffb74d;
  }
  .branch-banner .clear-btn {
    margin-left: auto; cursor: pointer;
    background: rgba(0,0,0,0.08); border: none;
    padding: 4px 10px; border-radius: 4px;
    font-size: 12px; color: #6d4c00;
  }
  .branch-banner .clear-btn:hover { background: rgba(0,0,0,0.15); }

  .lineage-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 10px;
    background: rgba(255,152,0,0.15); color: #c66900;
    font-size: 10px; font-weight: 600;
    margin-left: 6px;
  }

  .loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: #86868b;
    font-size: 15px;
  }
  .loading.show { display: block; }

  .error-msg {
    color: #d32f2f;
    font-size: 14px;
    margin-top: 12px;
  }

  .count-info {
    font-size: 13px;
    color: #86868b;
    margin-bottom: 12px;
  }

  /* 内容分析：chips */
  .chip-group {
    margin-top: 14px;
  }
  .chip-group .label {
    font-size: 12px;
    color: #86868b;
    margin-bottom: 6px;
    font-weight: 500;
  }
  .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .chip {
    font-size: 13px;
    padding: 6px 12px;
    background: #f5f5f7;
    border: 1px solid transparent;
    border-radius: 16px;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .chip:hover { background: #e8e8ed; border-color: #0071e3; }
  .chip.used { background: #e3f2fd; color: #1565c0; border-color: #1565c0; }
  .chip.keyword { background: #fff8e1; color: #7b5a00; }
  .chip.keyword:hover { background: #ffecb3; border-color: #e65100; }
  .btn-secondary {
    background: #fff;
    color: #0071e3;
    border: 1px solid #0071e3;
  }
  .btn-secondary:hover { background: #f0f7ff; }

  /* Skill 卡片 */
  .skill-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
  }
  .skill-card {
    padding: 12px 14px;
    border: 2px solid #e0e0e5;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
  }
  .skill-card:hover { border-color: #0071e3; }
  .skill-card.selected {
    border-color: #0071e3;
    background: #f0f7ff;
  }
  .skill-card .skill-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1d1d1f;
  }
  .skill-card .skill-desc {
    font-size: 12px;
    color: #86868b;
    line-height: 1.4;
  }

  /* 视觉元素：多选开关 */
  .ve-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
  }
  .ve-group-title {
    font-size: 12px;
    color: #86868b;
    font-weight: 500;
    margin-bottom: 8px;
  }
  .ve-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .ve-chip {
    font-size: 13px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #d2d2d7;
    border-radius: 16px;
    color: #424245;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
  }
  .ve-chip:hover { border-color: #0071e3; color: #0071e3; }
  .ve-chip.active {
    background: #0071e3;
    color: #fff;
    border-color: #0071e3;
  }

  /* 结果图卡片：hover 浮层 prompt + 单图复制 */
  .result-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
  }
  .result-card img {
    width: 100%;
    display: block;
    border-radius: 0;
    margin-bottom: 0;
  }
  .result-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,0.85) 100%);
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    pointer-events: none;
  }
  .result-card:hover .overlay { opacity: 1; }
  .result-card .overlay-prompt {
    color: #fff;
    font-size: 11px;
    line-height: 1.4;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
  }
  .result-card .overlay-actions {
    display: flex;
    gap: 6px;
    pointer-events: auto;
  }
  .result-card .card-btn {
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.95);
    border: none;
    border-radius: 4px;
    color: #1d1d1f;
    cursor: pointer;
    font-weight: 500;
  }
  .result-card .card-btn:hover { background: #fff; }
  .result-card .card-btn.copied { background: #2e7d32; color: #fff; }
  .result-card .style-label {
    padding: 10px 12px;
    background: #fff;
    font-size: 13px;
    color: #1d1d1f;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .result-card .style-label .tier {
    position: static;
    font-size: 10px;
    padding: 2px 6px;
  }

  /* 统一 pill 按钮组（替代下拉） */
  .pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .pill {
    padding: 8px 14px;
    font-size: 14px;
    background: #fff;
    border: 1.5px solid #d2d2d7;
    border-radius: 10px;
    color: #424245;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .pill:hover { border-color: #0071e3; color: #0071e3; }
  .pill.active {
    background: #0071e3;
    color: #fff;
    border-color: #0071e3;
  }
  .pill.active .pill-sub { color: rgba(255,255,255,0.85); }
  .pill .pill-sub {
    font-size: 11px;
    color: #86868b;
    font-weight: 400;
  }
  .pill-sm {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 8px;
  }
  .pill-num {
    min-width: 44px;
    justify-content: center;
  }
  .field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #424245;
    margin-bottom: 8px;
  }

  /* 情景模板：卡片 + 展开表单 */
  .scene-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
  }
  .scene-card {
    padding: 14px 12px;
    border: 2px solid #e0e0e5;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
    text-align: center;
  }
  .scene-card:hover { border-color: #0071e3; transform: translateY(-1px); }
  .scene-card.active {
    border-color: #0071e3;
    background: #f0f7ff;
  }
  .scene-card .emoji { font-size: 28px; display: block; margin-bottom: 6px; }
  .scene-card .sc-name { font-size: 14px; font-weight: 600; color: #1d1d1f; }
  .scene-card .sc-scene { font-size: 11px; color: #86868b; margin-top: 2px; }
  .scene-card.has-cover { padding: 0; overflow: hidden; text-align: left; }
  .scene-card .sc-cover {
    width: 100%; aspect-ratio: 3/4; object-fit: cover;
    display: block; background: #f5f5f7;
  }
  .scene-card .sc-body { padding: 8px 10px; }
  .scene-card .sc-badge {
    position: absolute; top: 6px; right: 6px;
    background: rgba(0,0,0,0.65); color: #fff;
    font-size: 10px; font-weight: 600;
    padding: 2px 6px; border-radius: 4px;
    letter-spacing: 0.3px;
  }
  .scene-card { position: relative; }
  .scene-card .sc-source {
    font-size: 10px; color: #86868b; margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  /* 非 quick Tab 的内容初始隐藏改用 HTML inline style="display:none"，
     这样 switchTab 把 inline 清掉后能恢复到默认 block；用类选择器会顶死 inline 空字符串。 */

  /* Tab 导航 */
  .main-tabs {
    display: flex;
    gap: 8px;
    margin: 20px 0 16px;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 0;
  }
  .main-tab {
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #86868b;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all .15s;
    margin-bottom: -1px;
  }
  .main-tab:hover { color: #0071e3; }
  .main-tab.active {
    color: #0071e3;
    border-bottom-color: #0071e3;
    font-weight: 600;
  }

  .scene-form {
    background: #fafafc;
    border-radius: 10px;
    padding: 16px;
    margin-top: 8px;
  }
  .scene-form .field-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
  }
  .scene-form .field-row label {
    font-size: 13px;
    color: #424245;
    font-weight: 500;
  }
  .scene-form .field-row input,
  .scene-form .field-row select {
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    background: #fff;
    outline: none;
  }
  .scene-form .field-row input:focus,
  .scene-form .field-row select:focus {
    border-color: #0071e3;
  }
  .scene-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    align-items: center;
    flex-wrap: wrap;
  }
