/* ===== 选型工具 Web 版 v0.0.3 - 样式表 ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* ===== 头部 ===== */
.header {
    text-align: center;
    padding: 24px 0 20px;
    position: relative;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.subtitle {
    font-size: 14px;
    color: #888;
}

.version-tag {
    display: inline-block;
    background: #667eea;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
}

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}

.section-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.section-hint {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
}

/* ===== 前置筛选 ===== */
.filter-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-question {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.filter-label {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a2e;
    min-width: 110px;
    padding-top: 7px;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-option {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    position: relative;
}

.radio-option:hover {
    border-color: #4a7dff;
    background: #f7f9ff;
}

.radio-option input[type="radio"] {
    margin-right: 6px;
    accent-color: #4a7dff;
    cursor: pointer;
}

.radio-option:has(input:checked) {
    border-color: #4a7dff;
    background: #eef3ff;
    font-weight: 500;
}

.radio-option:has(input:disabled) {
    opacity: 0.4;
    cursor: not-allowed;
}

.radio-option:has(input:disabled):hover {
    border-color: #e0e0e0;
    background: #fff;
}

/* Tooltip */
.radio-option[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #fff;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: normal;
    width: 220px;
    text-align: center;
    z-index: 100;
    margin-bottom: 6px;
    pointer-events: none;
    line-height: 1.5;
}

.radio-option[data-tooltip]:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1a1a2e;
    z-index: 100;
    margin-bottom: -2px;
    pointer-events: none;
}

.filter-hint {
    font-size: 13px;
    color: #aaa;
    text-align: center;
    padding: 20px 0;
}

/* ===== 主机卡片（缩小，2列网格） ===== */
.host-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (max-width: 480px) {
    .host-cards {
        grid-template-columns: 1fr;
    }
}

.host-card {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    min-height: 56px;
}

.host-card:hover {
    border-color: #4a7dff;
    background: #f7f9ff;
}

.host-card.selected {
    border-color: #4a7dff;
    background: #eef3ff;
}

.host-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.host-card.disabled:hover {
    border-color: #e8e8e8;
    background: #fff;
}

.host-radio {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    accent-color: #4a7dff;
    cursor: pointer;
    flex-shrink: 0;
}

.host-info {
    flex: 1;
    min-width: 0;
}

.host-model {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.3;
}

.host-desc {
    font-size: 10px;
    color: #aaa;
    margin-top: 1px;
    line-height: 1.2;
}

.host-tags {
    display: flex;
    gap: 4px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.host-tag {
    font-size: 9px;
    padding: 0px 4px;
    border-radius: 3px;
    background: #f0f2f5;
    color: #888;
    line-height: 1.4;
}

.host-tag.e-tag {
    background: #fff3e0;
    color: #e65100;
}

/* ===== 物镜数量提示 ===== */
#obj-count-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 16px 20px;
}

.obj-count-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 14px;
}

.obj-count-text {
    font-size: 18px;
    font-weight: 600;
}

.obj-count-detail {
    font-size: 12px;
    opacity: 0.85;
}

.ring-light-notice {
    margin-top: 8px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 10px;
    border-radius: 6px;
}

/* ===== 物镜列表（缩小卡片） ===== */
.obj-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (max-width: 480px) {
    .obj-list {
        grid-template-columns: 1fr;
    }
}

.obj-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    min-height: 48px;
}

.obj-item:hover {
    border-color: #4a7dff;
    background: #f7f9ff;
}

.obj-item.selected {
    border-color: #4a7dff;
    background: #eef3ff;
}

.obj-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.obj-item.disabled:hover {
    border-color: #e8e8e8;
    background: #fff;
}

.obj-checkbox {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    accent-color: #4a7dff;
    cursor: pointer;
    flex-shrink: 0;
}

.obj-info {
    flex: 1;
    min-width: 0;
}

/* 名称突出显示 */
.obj-desc {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.3;
}

.obj-model {
    font-size: 11px;
    color: #aaa;
    margin-top: 1px;
    line-height: 1.2;
}

.obj-specs {
    font-size: 10px;
    color: #bbb;
    margin-top: 1px;
    line-height: 1.2;
}

/* ===== 复选框标签 ===== */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 6px 0;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 4px;
    margin-right: 10px;
    width: 16px;
    height: 16px;
    accent-color: #4a7dff;
    cursor: pointer;
}

/* ===== 软件 ===== */
.software-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f7f9fc;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.software-tag {
    background: #52c41a;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 10px;
}

.software-version {
    margin-left: auto;
    color: #888;
    font-size: 12px;
}

/* ===== Mountains 模块（缩小，2列网格） ===== */
.mountains-modules {
    margin-top: 12px;
    padding: 12px;
    background: #f7f9fc;
    border-radius: 8px;
}

.mountains-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.mountains-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

@media (max-width: 480px) {
    .mountains-list {
        grid-template-columns: 1fr;
    }
}

.mountains-item {
    display: flex;
    align-items: flex-start;
    padding: 6px 8px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 6px;
    transition: all 0.2s;
    min-height: 48px;
}

.mountains-item:hover {
    background: #eef3ff;
    border-color: #c5d6ff;
}

.mountains-item:has(input:checked) {
    background: #eef3ff;
    border-color: #4a7dff;
}

.mountains-item input[type="checkbox"] {
    margin-top: 3px;
    margin-right: 6px;
    width: 14px;
    height: 14px;
    accent-color: #4a7dff;
    cursor: pointer;
    flex-shrink: 0;
}

.mountains-info {
    flex: 1;
    min-width: 0;
}

.mountains-item-name {
    font-weight: 600;
    color: #1a1a2e;
    font-size: 12px;
    line-height: 1.3;
}

.mountains-item-cn {
    font-size: 10px;
    color: #888;
    margin-top: 1px;
    line-height: 1.2;
}

.mountains-item-desc {
    font-size: 9px;
    color: #bbb;
    margin-top: 1px;
    line-height: 1.2;
    display: none;
}

/* 标准版模块样式 */
.mountains-item.standard-module {
    background: #eef3ff;
    border-color: #4a7dff;
    cursor: default;
}

.mountains-item.standard-module:hover {
    background: #eef3ff;
    border-color: #4a7dff;
}

.mountains-item.standard-module .mountains-item-name {
    color: #4a7dff;
}

/* ===== 文档类型 ===== */
.doc-types {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doc-types .checkbox-label {
    padding: 10px 12px;
    background: #f7f9fc;
    border-radius: 8px;
    flex-direction: column;
    align-items: flex-start;
}

.doc-types .checkbox-label input {
    margin-right: 0;
    margin-bottom: 6px;
}

.doc-types .checkbox-label span:first-of-type {
    font-weight: 500;
    color: #1a1a2e;
}

.doc-type-desc {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
    margin-left: 26px;
}

/* ===== 生成按钮 ===== */
.generate-section {
    text-align: center;
    padding: 20px 0 10px;
}

.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 14px 48px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 28px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.generate-btn:active:not(:disabled) {
    transform: translateY(0);
}

.generate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.generate-btn.loading {
    opacity: 0.8;
    cursor: wait;
}

.status-msg {
    margin-top: 12px;
    font-size: 13px;
    min-height: 20px;
}

.status-msg.error { color: #ff4d4f; }
.status-msg.success { color: #52c41a; }
.status-msg.info { color: #4a7dff; }

/* ===== 结果 ===== */
.result-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-files {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-file-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: #f7f9fc;
    border-radius: 8px;
}

.file-icon {
    width: 32px;
    height: 32px;
    background: #2b579a;
    color: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    color: #1a1a2e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.download-btn {
    background: #4a7dff;
    color: #fff;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
    flex-shrink: 0;
}

.download-btn:hover {
    background: #3a6dff;
}

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    padding: 20px 0;
    font-size: 12px;
    color: #aaa;
}

.changelog-link {
    color: #4a7dff;
    text-decoration: none;
}

.changelog-link:hover {
    text-decoration: underline;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .container {
        padding: 12px 10px 30px;
    }

    .card {
        padding: 16px;
        margin-bottom: 12px;
    }

    .header h1 {
        font-size: 20px;
    }

    .generate-btn {
        padding: 12px 36px;
        font-size: 15px;
    }

    .filter-question {
        flex-direction: column;
        gap: 6px;
    }

    .filter-label {
        min-width: auto;
        padding-top: 0;
    }
}
