* {
    box-sizing: border-box;
    font-family: system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}
body {
    background: #0d1117;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.card {
    max-width: 1280px;
    width: 100%;
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 16px;
    padding: 20px 24px;
}
h1 {
    color: #e6edf3;
    font-size: 1.5rem;
    margin: 0 0 4px 0;
    font-weight: 600;
}
/* 切换开关 — radio group 样式（仿 DeepSeek） */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}
.toggle-group label {
    color: #6e7681;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color .15s;
}
.toggle-group label::before {
    content: '○';
    font-size: 0.75rem;
    color: #484f58;
    transition: color .15s;
}
.toggle-group label.active {
    color: #e6edf3;
    font-weight: 500;
}
.toggle-group label.active::before {
    content: '●';
    color: #58a6ff;
}
.toggle-group label.inactive:hover {
    color: #8b949e;
}
.toggle-group label.inactive:hover::before {
    color: #6e7681;
}
.car-tag.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: #21262d;
}
.star-display {
    display: inline-block;
    margin-left: 3px;
    font-size: 0.7rem;
    color: #e3b341;
    cursor: pointer;
    padding: 1px 4px;
    user-select: none;
    position: relative;
    border-radius: 4px;
}
.star-display:hover {
    background: #21262d;
}
.star-popover {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    white-space: nowrap;
}
.star-popover.show {
    display: flex;
    gap: 2px;
}
.star-opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #6e7681;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all .12s;
}
.star-opt:hover {
    background: #30363d;
    color: #e3b341;
}
.star-opt.active-star {
    background: #1f3a5f;
    color: #f0c94b;
    font-weight: 600;
}
/* ===== 副标题 ===== */
.sub {
    color: #6e7681;
    margin-bottom: 24px;
    font-size: 0.8rem;
}
/* ===== 地图选择行 ===== */
.map-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}
.map-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #0d1117;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid #21262d;
}
.map-index {
    width: 28px;
    color: #484f58;
    font-size: 0.9rem;
    flex-shrink: 0;
    text-align: center;
}
.map-select-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    flex: 1;
}
.select-wrapper {
    flex: 1 1 210px;
    min-width: 170px;
}
.select-wrapper label {
    display: block;
    font-size: 0.7rem;
    color: #6e7681;
    margin-bottom: 4px;
    font-weight: 500;
}
select {
    width: 100%;
    padding: 10px 14px;
    background: #0d1117;
    border: 1px solid #30363d;
    color: #e6edf3;
    border-radius: 10px;
    font-size: 0.88rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
}
select:focus {
    border-color: #58a6ff;
    outline: none;
}
select:disabled {
    opacity: 0.6;
}
/* ===== 车库区域 ===== */
.garage {
    background: #161b22;
    border-radius: 12px;
    padding: 16px;
}
.garage-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}
.garage > summary {
    cursor: pointer;
    list-style: none;
    align-items: center;
    margin-bottom: 0;
}
.garage > summary::-webkit-details-marker { display: none; }
.garage > summary:focus-visible { outline: 2px solid #58a6ff; outline-offset: 4px; }
.garage[open] > summary { margin-bottom: 14px; }
.garage-fold-label { color: #8b949e; font-size: 0.85rem; }
.garage-fold-label::after { content: '展开 ▾'; }
.garage[open] .garage-fold-label::after { content: '收起 ▴'; }
.garage-body > .garage-actions { margin-bottom: 14px; justify-content: flex-end; }
.zone-hint {
    display: none;
    margin: -6px 0 12px 0;
    padding: 8px 14px;
    background: #1c2333;
    border: 1px solid #e3b341;
    border-radius: 8px;
    color: #e3b341;
    font-size: 0.8rem;
    line-height: 1.4;
}
.zone-hint.show {
    display: block;
}
.zone-hint::before {
    content: '⚠️ ';
}
.garage-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #e6edf3;
}
.garage-actions {
    display: flex;
    gap: 12px;
}
.garage-btn {
    background: #21262d;
    border: 1px solid #30363d;
    color: #e6edf3;
    padding: 4px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
}
.garage-btn:hover {
    background: #30363d;
    border-color: #58a6ff;
}
.car-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 270px;
    overflow-y: scroll;
    padding: 8px 6px;
    background: #0d1117;
    border-radius: 12px;
    border: 1px solid #21262d;
}
.car-tag {
    background: #21262d;
    color: #e6edf3;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    border: 1px solid #30363d;
    cursor: pointer;
    user-select: none;
}
.car-tag.selected {
    background: #1f3a5f;
    color: #58a6ff;
    border-color: #58a6ff;
    font-weight: 600;
}
.class-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.class-filter-btn {
    background: #21262d;
    color: #8b949e;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    border: 1px solid #30363d;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}
.class-filter-btn.active {
    background: #1f3a5f;
    color: #58a6ff;
    border-color: #58a6ff;
}
.class-filter-btn:hover {
    border-color: #58a6ff;
}
.garage-search {
    width: 100%;
    padding: 10px 18px;
    background: #0d1117;
    border: 1px solid #30363d;
    color: #e6edf3;
    border-radius: 10px;
    font-size: 0.85rem;
    outline: none;
    margin-bottom: 12px;
    box-sizing: border-box;
}
.garage-search:focus {
    border-color: #58a6ff;
}
.garage-search::placeholder {
    color: #484f58;
}
/* ===== 搜索无匹配提示 ===== */
.no-match {
    color: #484f58;
    text-align: center;
    width: 100%;
    padding: 20px;
    font-size: 0.9rem;
}
/* ===== 生成按钮 ===== */
.action {
    text-align: center;
    margin: 18px 0 24px;
}
.recommend-btn {
    background: #238636;
    border: none;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 12px 36px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s;
}
.recommend-btn:hover {
    background: #2ea043;
}
/* ===== 结果面板 ===== */
.result-panel {
    background: #161b22;
    border-radius: 12px;
    padding: 16px;
}
.result-title {
    color: #e6edf3;
    margin-bottom: 14px;
    font-size: 0.95rem;
    font-weight: 500;
}
.scheme-selector {
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}
.scheme-selector label {
    color: #8b949e;
    font-weight: 400;
}
.scheme-selector select {
    width: 100%;
    min-width: 0;
    background: #0d1117;
    border-color: #30363d;
}
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.result-item {
    background: #0d1117;
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #21262d;
}
.result-map {
    font-weight: 600;
    color: #e6edf3;
    font-size: 0.9rem;
    margin-bottom: 4px;
}
.result-bigmap {
    font-size: 0.8rem;
    color: #8b949e;
    margin-bottom: 16px;
}
.result-car {
    padding: 4px 0;
    font-weight: 600;
    color: #e6edf3;
    font-size: 1.1rem;
}
.result-stars { color: #8b949e; font-size: 0.85rem; margin-left: 8px; font-weight: 400; }
.result-unit { color: #8b949e; font-size: 0.8rem; font-weight: 400; }
.result-item .result-score { color: #58a6ff; font-size: 1.25rem; margin-top: 8px; }
.result-car.empty {
    background: #161b22;
    color: #484f58;
    border: 1px dashed #30363d;
}
.priority-badge {
    font-size: 0.6rem;
    background: rgba(1,4,14,0.4);
    border-radius: 6px;
    display: inline-block;
    margin-top: 4px;
    color: #6e7681;
    padding: 2px 6px;
}
.site-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #30363d;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.6;
}
.site-footer a { color: #8b949e; text-decoration: underline; }
.site-footer a:hover { color: #58a6ff; }
.site-footer a:focus-visible { outline: 2px solid #58a6ff; outline-offset: 4px; }
.footer-note {
    color: #484f58;
    text-align: right;
    margin-top: 10px;
    font-size: 0.7rem;
}
.badge-pareto {
    background: #21262d;
    color: #8b949e;
    border-radius: 40px;
    font-size: 0.7rem;
    padding: 2px 10px;
    margin-left: 8px;
    font-weight: normal;
}
/* ===== 加载动画遮罩 ===== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    justify-content: center; align-items: center;
    z-index: 999;
}
.loading-overlay.show { display: flex; }
.loading-box {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 12px;
    padding: 32px 48px;
    text-align: center;
}
.loading-spinner {
    width: 50px; height: 50px;
    border: 4px solid #21262d;
    border-top: 4px solid #58a6ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box p { color: #e6edf3; font-size: 0.9rem; margin: 10px 0 0; }
.result-score {
    font-size: 0.75rem;
    color: #83a0d8;
    margin-top: 2px;
}
