/* ========== 变量 ========== */
:root {
    --primary: #67b168;
    --primary-light: #7ec87f;
    --primary-dark: #519a52;
    --bg: #f2f7ee;
    --card-bg: #f3f9f0;
    --text: #333333;
    --text-light: #999999;
    --border: #eeeeee;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --radius: 12px;
}

/* ========== 基础 ========== */
* { 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: var(--bg);
    color: var(--text);
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 70px;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
}
::-webkit-scrollbar { width: 0; }

/* ========== 头部 ========== */
.header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    padding: 12px 16px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-sub {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 400;
    margin-top: 2px;
}

/* ========== 轮播图 ========== */
.carousel {
    margin: 12px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 750 / 400;
    background: #e8e8e8;
}
.carousel-inner {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}
.carousel-item {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}
.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.carousel-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}
.carousel-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transition: all 0.3s;
}
.carousel-dot.active {
    background: #fff;
    width: 18px;
    border-radius: 3px;
}

/* ========== 导航卡片 ========== */
.nav-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 12px 12px;
}
.nav-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
    text-decoration: none;
    display: block;
    aspect-ratio: 2 / 1;
}
.nav-card:active { transform: scale(0.97); }
.nav-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========== 计算卡片 ========== */
.calc-card {
    background: var(--card-bg);
    margin: 0 12px 12px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.calc-header {
    padding: 14px 16px;
    font-size: 17px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.calc-header::before {
    content: '';
    width: 4px; height: 18px;
    background: var(--primary);
    border-radius: 2px;
}
.calc-body { padding: 16px; }

/* ========== 表单 ========== */
.form-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.form-row:last-child { border-bottom: none; }
.form-label {
    width: 90px;
    font-size: 15px;
    color: var(--text);
    flex-shrink: 0;
}
.form-control {
    flex: 1;
    display: flex;
    align-items: center;
}

/* 单选 */
.radio-group { display: flex; gap: 20px; }
.radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 15px;
}
.radio-item input { display: none; }
.radio-circle {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.radio-item input:checked + .radio-circle {
    border-color: var(--primary);
    background: var(--primary);
}
.radio-item input:checked + .radio-circle::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
}

/* 输入框 */
.input-wrap { flex: 1; position: relative; }
.input-wrap input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    background: #fafafa;
    color: var(--text);
}
.input-wrap input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(103,177,104,0.15);
}
.input-wrap input::placeholder { color: #ccc; }
.input-wrap input:disabled {
    background: #f0f0f0;
    color: #ccc;
    cursor: not-allowed;
}
.input-unit {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
}

/* 分类标题 */
.section-title {
    font-size: 14px;
    color: var(--primary);
    margin: 12px 0 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}
.section-title .tag {
    font-size: 12px;
    background: #f0f8f0;
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 4px;
}

/* 评分标准 */
.standard-select {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 15px;
    color: var(--primary);
    font-weight: 500;
}

/* 查询按钮 */
.btn-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(103,177,104,0.3);
}
.btn-submit:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(103,177,104,0.3);
}

/* ========== 弹窗 ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 30px;
}
.modal-overlay.show { display: flex; }
.modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 340px;
    overflow: hidden;
    animation: modalIn 0.3s ease;
}
@keyframes modalIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-header {
    background: #fff;
    color: var(--text);
    padding: 24px 20px 16px;
    text-align: center;
}
.modal-brand {
    font-size: 24px;
    font-weight: 700;
    color: #000;
    margin-bottom: 4px;
    letter-spacing: 1px;
}
.modal-brand-sub {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 14px;
}
.modal-header .year-tag {
    display: inline-block;
    background: #f0f8f0;
    padding: 2px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 6px;
}
.modal-header .total-label {
    font-size: 15px;
    color: var(--text-light);
}
.modal-header .total-score {
    font-size: 52px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 4px;
}
.modal-body { padding: 0 20px 20px; }
.result-table { width: 100%; border-collapse: collapse; }
.result-table th {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 400;
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #eee;
}
.result-table td {
    font-size: 15px;
    text-align: center;
    padding: 14px 8px;
    border-bottom: 1px solid #f5f5f5;
    color: #333;
}
.result-table td:last-child { color: #333; font-weight: 400; }
.result-table tbody tr:last-child td { border-bottom: none; }
.btn-continue {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 25px;
    font-size: 15px;
    color: var(--text);
    cursor: pointer;
    margin-top: 18px;
    transition: all 0.2s;
    letter-spacing: 2px;
}
.btn-continue:active { background: #fafafa; border-color: #ccc; }

/* ========== 底部导航 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: #fff;
    display: flex;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 100;
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 12px;
}
.nav-item.active { color: var(--primary); }
.nav-item svg { width: 26px; height: 26px; margin-bottom: 2px; }

/* ========== 动画 ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.calc-card { animation: fadeInUp 0.5s ease 0.2s both; }
.nav-cards { animation: fadeInUp 0.4s ease 0.1s both; }
.carousel { animation: fadeInUp 0.3s ease both; }

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 300;
    animation: toastIn 0.3s ease;
    pointer-events: none;
}
@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ========== 输入提示气泡 ========== */
.input-tooltip {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.input-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    border-width: 0 6px 6px 6px;
    border-style: solid;
    border-color: transparent transparent var(--primary) transparent;
}

/* ========== 其他 ========== */
.form-row.disabled .form-label { color: #ccc; }
.score-highlight { color: var(--primary); font-weight: 700; font-size: 16px; }
.score-zero { color: var(--text-light); }
