/* 全局样式 - 统一灰度色系 */
* {
    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: #ffffff;
    color: #333333;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* 头部 */
.header {
    text-align: center;
    margin-bottom: 60px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.logo {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: #333333;
}

.subtitle {
    font-size: 16px;
    color: #666666;
    letter-spacing: 1px;
}

.warning-banner {
    margin-top: 20px;
    padding: 12px 20px;
    background: #f5f5f5;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.warning-icon {
    font-size: 20px;
    color: #666666;
}

.warning-text {
    font-size: 13px;
    color: #666666;
}

/* 输入区域 */
.input-section {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555555;
    font-weight: 500;
}

textarea,
input[type="text"],
select {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    color: #333333;
    font-size: 15px;
    transition: all 0.3s ease;
}

textarea:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #999999;
    background: #ffffff;
}

textarea {
    resize: vertical;
    font-family: inherit;
}

/* 参数编辑器 */
.params-editor {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid #e0e0e0;
}

.params-editor h3 {
    font-size: 16px;
    margin-bottom: 20px;
    color: #333333;
}

.params-hint {
    font-size: 13px;
    color: #999999;
    font-weight: 400;
}

.params-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.param-edit-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.param-edit-item label {
    font-size: 13px;
    color: #666666;
    margin-bottom: 0;
}

.param-edit-item input[type="number"],
.param-edit-item select {
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    color: #333333;
    font-size: 15px;
}

.param-edit-item input[type="number"]:focus,
.param-edit-item select:focus {
    outline: none;
    border-color: #999999;
}

.param-range {
    font-size: 11px;
    color: #999999;
}

/* 按钮 */
.btn-primary,
.btn-secondary {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: #333333;
    color: #ffffff;
    width: 100%;
}

.btn-primary:hover {
    background: #555555;
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: #333333;
    border: 1px solid #333333;
}

.btn-secondary:hover {
    background: #333333;
    color: #ffffff;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 3px solid #e0e0e0;
    border-top-color: #333333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 结果区域 */
.results-section {
    animation: fadeIn 0.5s ease;
}

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

/* 用户画像参数卡片 */
.user-params-card {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 30px;
}

.user-params-card h3 {
    font-size: 16px;
    margin-bottom: 20px;
    color: #333333;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.param-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.param-label {
    font-size: 12px;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.param-value {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
}

/* 指标网格 */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.metric-card {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    transition: all 0.3s ease;
}

.metric-card:hover {
    border-color: #999999;
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.metric-label {
    font-size: 13px;
    color: #666666;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333333;
}

.metric-rating {
    display: inline-block;
    padding: 4px 12px;
    background: #e0e0e0;
    border-radius: 12px;
    font-size: 12px;
    margin-bottom: 12px;
    color: #555555;
}

.metric-rating.excellent { background: #d0d0d0; color: #333333; }
.metric-rating.good { background: #e0e0e0; color: #555555; }
.metric-rating.average { background: #eeeeee; color: #666666; }
.metric-rating.poor { background: #f5f5f5; color: #999999; }

.metric-desc {
    font-size: 13px;
    color: #666666;
    line-height: 1.4;
}

/* 决策分布 */
.decision-section {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 40px;
}

.decision-section h3 {
    font-size: 18px;
    margin-bottom: 24px;
    color: #333333;
}

.decision-bar {
    display: grid;
    grid-template-columns: 80px 1fr;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.bar-label {
    font-size: 14px;
    color: #666666;
    text-align: right;
}

.bar-container {
    position: relative;
    height: 32px;
    background: #eeeeee;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    transition: width 1s ease;
}

.bar-buy { background: linear-gradient(90deg, #666666 0%, #888888 100%); }
.bar-hold { background: linear-gradient(90deg, #999999 0%, #aaaaaa 100%); }
.bar-sell { background: linear-gradient(90deg, #444444 0%, #666666 100%); }

.bar-text {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 建议列表 */
.suggestions-section {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 40px;
}

.suggestions-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333333;
}

.suggestions-list {
    list-style: none;
}

.suggestions-list li {
    padding: 12px 0;
    padding-left: 24px;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
    color: #555555;
    line-height: 1.6;
}

.suggestions-list li:last-child {
    border-bottom: none;
}

.suggestions-list li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #999999;
}

/* 下载区域 */
.download-section {
    text-align: center;
    padding: 40px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.download-note {
    margin-top: 12px;
    font-size: 13px;
    color: #666666;
}

/* 页脚 */
.footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    color: #999999;
    font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }

    .logo {
        font-size: 36px;
    }

    .input-section {
        padding: 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .decision-bar {
        grid-template-columns: 60px 1fr;
    }
}

/* ========== 分析模式选择 ========== */
.mode-selector {
    margin-top: 24px;
    margin-bottom: 24px;
}
.mode-selector h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
}
.mode-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.mode-option {
    cursor: pointer;
    position: relative;
}
.mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.mode-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 16px;
    background: #fafafa;
    transition: all 0.15s;
    height: 100%;
}
.mode-option:hover .mode-card {
    border-color: #999;
    background: #f5f5f5;
}
.mode-option input[type="radio"]:checked + .mode-card {
    border-color: #333;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.mode-card-title {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 6px;
    color: #222;
}
.mode-card-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}
.mode-card-desc strong {
    color: #333;
}
@media (max-width: 768px) {
    .mode-options { grid-template-columns: 1fr; }
}

/* ========== 模式徽章(单模式结果顶部) ========== */
.mode-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 16px;
    border: 1px solid;
}
.mode-badge-math {
    background: #eef4ff;
    color: #2848a8;
    border-color: #2848a8;
}
.mode-badge-llm {
    background: #f3eaff;
    color: #6a2cae;
    border-color: #6a2cae;
}

/* ========== 双模式对比视图 ========== */
.compare-header {
    text-align: center;
    margin-bottom: 24px;
}
.compare-header h2 {
    margin: 0;
    color: #222;
}
.compare-subtitle {
    color: #777;
    margin-top: 6px;
    font-size: 14px;
}
.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.compare-column {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}
.compare-col-header {
    border-bottom: 2px solid #eee;
    padding-bottom: 12px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.compare-col-header h3 {
    margin: 0;
    font-size: 18px;
}
.compare-col-header.math h3 { color: #2848a8; }
.compare-col-header.llm h3  { color: #6a2cae; }
.compare-col-header.math    { border-bottom-color: #2848a8; }
.compare-col-header.llm     { border-bottom-color: #6a2cae; }
.compare-col-meta {
    font-size: 12px;
    color: #888;
}
.compare-metrics {
    margin-bottom: 18px;
}
.cm-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    font-size: 14px;
}
.cm-row:last-child { border-bottom: 0; }
.cm-label { color: #555; }
.cm-value { font-weight: bold; color: #222; font-variant-numeric: tabular-nums; }
.cm-rating {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 32px;
    text-align: center;
}
.cm-rating.excellent { background: #dff5e0; color: #1f7a32; }
.cm-rating.good      { background: #e4ecff; color: #2848a8; }
.cm-rating.average   { background: #fff4d6; color: #8a5b00; }
.cm-rating.poor      { background: #fde0e0; color: #a82828; }

.compare-decisions {
    margin-bottom: 18px;
}
.compare-decisions h4 {
    font-size: 14px;
    color: #333;
    margin: 0 0 10px 0;
}
.compare-suggestions h4 {
    font-size: 14px;
    color: #333;
    margin: 0 0 8px 0;
}
.compare-suggestions ul {
    margin: 0;
    padding-left: 20px;
}
.compare-suggestions li {
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
    line-height: 1.5;
}
.compare-summary {
    margin-top: 24px;
    padding: 18px 22px;
    background: #fafafa;
    border-left: 4px solid #333;
    border-radius: 4px;
}
.compare-summary h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
}
.compare-summary-list {
    margin: 0;
    padding-left: 22px;
}
.compare-summary-list li {
    font-size: 14px;
    margin-bottom: 4px;
    color: #444;
}
.compare-note {
    margin: 12px 0 0 0;
    font-size: 13px;
    color: #8a5b00;
    background: #fff8e1;
    padding: 8px 12px;
    border-radius: 4px;
}
@media (max-width: 900px) {
    .compare-grid { grid-template-columns: 1fr; }
}
