/* ===== 全局重置 & 基础 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: #f5efe6;
    background-image:
        radial-gradient(ellipse at 20% 30%, rgba(230, 200, 160, 0.35) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgba(200, 170, 130, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 0%, rgba(240, 220, 190, 0.3) 0%, transparent 50%);
    font-family: 'Georgia', 'Noto Serif SC', 'SimSun', 'STSong', serif;
    color: #4a3a2a;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* ===== 装饰粒子 ===== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(200, 160, 100, 0.25);
    border-radius: 50%;
    animation: float linear infinite;
}
@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.3; }
    100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* ===== 顶部装饰 ===== */
.top-ornament {
    position: relative;
    z-index: 1;
    width: 100%;
    text-align: center;
    padding: 32px 20px 8px;
}
.top-ornament::before,
.top-ornament::after {
    content: '';
    display: inline-block;
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c4a265, transparent);
    vertical-align: middle;
    margin: 0 14px;
}
.top-ornament .diamond {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #c4a265;
    transform: rotate(45deg);
    vertical-align: middle;
}

/* ===== 主标题 ===== */
.main-title {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 6px 20px 2px;
}
.main-title h1 {
    font-size: clamp(34px, 7vw, 58px);
    font-weight: 700;
    color: #6a4a2a;
    text-shadow: 0 1px 2px rgba(106, 74, 42, 0.15), 0 0 20px rgba(196, 162, 101, 0.2);
    letter-spacing: 14px;
}
.main-title .sub {
    font-size: clamp(12px, 2vw, 14px);
    color: #9a8a6a;
    letter-spacing: 8px;
    margin-top: 6px;
    font-style: italic;
}

/* ===== 三栏主布局 ===== */
.main-layout {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1300px;
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 28px;
    padding: 32px 20px 0;
    margin: 0 auto;
}

.col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.col-left {
    flex: 1 1 340px;
    max-width: 380px;
}

.col-center {
    flex: 0 0 auto;
    align-items: center;
}

.col-right {
    flex: 1 1 340px;
    max-width: 380px;
}

/* ===== 面板通用样式 ===== */
.panel {
    background: rgba(255, 252, 245, 0.85);
    border: 1px solid #d4c4a8;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(106, 74, 42, 0.08);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.panel-title {
    text-align: center;
    font-size: 13px;
    color: #8a7a5a;
    letter-spacing: 4px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8ddd0;
}

/* ===== 中间卡片（上下结构） ===== */
.center-card {
    width: 400px;
    background: linear-gradient(145deg, #faf5ea, #f0e8d8);
    border: 1px solid #d4c4a8;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(106, 74, 42, 0.08);
    overflow: hidden;
}

/* 顶部输入区域 */
.center-input-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 30px 18px;
    gap: 12px;
}
.center-input-area .hint {
    font-size: 13px;
    color: #b0a080;
    letter-spacing: 3px;
    text-align: center;
}
.center-input-area .input-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 252, 245, 0.9);
    border: 1px solid #d4c4a8;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 100%;
    max-width: 240px;
}
.center-input-area .input-wrapper:focus-within {
    border-color: #c4a265;
    box-shadow: 0 0 16px rgba(196, 162, 101, 0.2);
}
.center-input-area .input-wrapper .prefix {
    padding: 0 8px 0 16px;
    color: #b0a080;
    font-size: 14px;
    letter-spacing: 1px;
    user-select: none;
}
.center-input-area .input-wrapper input {
    width: 130px;
    padding: 13px 16px 13px 4px;
    background: transparent;
    border: none;
    outline: none;
    color: #4a3a2a;
    font-size: 24px;
    font-family: 'Georgia', serif;
    letter-spacing: 6px;
    text-align: center;
}
.center-input-area .input-wrapper input::placeholder {
    color: #d4c8b0;
    letter-spacing: 4px;
    font-size: 16px;
}
.center-input-area .input-wrapper input::-webkit-outer-spin-button,
.center-input-area .input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.center-input-area .input-wrapper input[type=number] {
    -moz-appearance: textfield;
}
.center-input-area .btn-divine {
    padding: 11px 52px;
    background: linear-gradient(135deg, #c4a265, #d4b87a, #c4a265);
    border: none;
    border-radius: 6px;
    color: #2a1a0a;
    font-size: 16px;
    font-family: 'Georgia', serif;
    letter-spacing: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.center-input-area .btn-divine::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,235,200,0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s;
}
.center-input-area .btn-divine:hover::before {
    opacity: 1;
}
.center-input-area .btn-divine:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(196, 162, 101, 0.35);
}
.center-input-area .btn-divine:active {
    transform: translateY(0);
}

/* 分隔线 */
.center-divider {
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c4a265, transparent);
    margin: 0 auto;
}

/* 底部结果区域 */
.center-result-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 24px 24px;
    min-height: 240px;
}
.center-result-area .top-line {
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c4a265, transparent);
    margin-bottom: 16px;
}

/* 评级徽章 */
.badge {
    display: inline-block;
    padding: 6px 26px;
    border: 1px solid;
    border-radius: 4px;
    font-size: 14px;
    letter-spacing: 4px;
    margin-bottom: 10px;
    background: rgba(255, 252, 245, 0.5);
}

/* 尾号显示 */
.number-display {
    font-size: 44px;
    font-weight: 700;
    letter-spacing: 10px;
    color: #4a3a2a;
    margin: 4px 0 8px;
}

/* 估值金额 */
.value-amount {
    font-size: 50px;
    font-weight: 700;
    color: #8a6030;
    margin: 2px 0;
}
.value-amount .unit {
    font-size: 20px;
    font-weight: 400;
    color: #b0a080;
}

/* 分隔 */
.divider-line {
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(196, 162, 101, 0.4), transparent);
    margin: 14px 0;
}

/* 建议文本 */
.suggestion {
    font-size: 16px;
    color: #8a6a3a;
    letter-spacing: 4px;
    margin-bottom: 4px;
    font-weight: 600;
}
.suggestion-desc {
    font-size: 12px;
    color: #b0a080;
    letter-spacing: 2px;
    text-align: center;
    line-height: 1.6;
}

/* 底部装饰 */
.center-result-area .bottom-line {
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(196, 162, 101, 0.3), transparent);
    margin-top: auto;
    margin-bottom: 8px;
}
.center-result-area .seal {
    font-size: 11px;
    color: #c4b8a0;
    letter-spacing: 3px;
}

/* ===== 评级颜色 ===== */
.rank-tianxuan {
    border-color: #c4a265;
    color: #7a5a30;
    background: rgba(196, 162, 101, 0.12);
}
.rank-shangshang {
    border-color: #b89860;
    color: #6a4a28;
    background: rgba(184, 152, 96, 0.1);
}
.rank-shang {
    border-color: #a08860;
    color: #5a4a28;
    background: rgba(160, 136, 96, 0.08);
}
.rank-zhong {
    border-color: #8a7a5a;
    color: #5a4a30;
    background: rgba(138, 122, 90, 0.06);
}
.rank-mo {
    border-color: #7a6a50;
    color: #5a4a38;
    background: rgba(122, 106, 80, 0.05);
}
.rank-fanchen {
    border-color: #6a5a40;
    color: #4a3a28;
    background: rgba(106, 90, 64, 0.04);
}

/* ===== 数字分析区域 ===== */
.analysis-panel {
    display: none;
}
.analysis-panel.visible {
    display: flex;
    flex-direction: column;
    flex: 1;
    animation: fadeUp 0.6s ease;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 总分条 */
.score-bar-wrap {
    margin-bottom: 14px;
}
.score-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #8a7a5a;
    letter-spacing: 2px;
    margin-bottom: 5px;
}
.score-bar-label .score-num {
    color: #6a4a2a;
    font-weight: 700;
    font-size: 14px;
}
.score-bar-track {
    width: 100%;
    height: 6px;
    background: #e8ddd0;
    border-radius: 3px;
    overflow: hidden;
}
.score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
    background: linear-gradient(90deg, #b0a080, #c4a265);
}

/* 分析条目列表 */
.analysis-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.analysis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    background: rgba(255, 252, 245, 0.6);
    border: 1px solid #ede5d8;
    font-size: 12px;
    color: #5a4a30;
    letter-spacing: 1px;
}
.analysis-item .item-label {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.analysis-item .item-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #c4a265;
    flex-shrink: 0;
}
.analysis-item .item-score {
    font-weight: 700;
    color: #8a6030;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 4px;
}
.analysis-item .item-score.positive {
    color: #7a8a3a;
}
.analysis-item .item-score.negative {
    color: #9a6a4a;
}

/* 无匹配提示 */
.empty-hint {
    text-align: center;
    color: #b0a080;
    font-size: 12px;
    letter-spacing: 2px;
    padding: 10px 0;
}

/* ===== 历史记录 ===== */
.history-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #e0d5c4;
    border-radius: 4px;
    background: rgba(255, 252, 245, 0.5);
    font-size: 12px;
    color: #6a5a3a;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
}
.history-item:hover {
    border-color: #c4a265;
    background: rgba(196, 162, 101, 0.08);
}
.history-item .h-num {
    font-weight: 700;
    font-size: 14px;
    color: #4a3a2a;
    flex-shrink: 0;
}
.history-item .h-rank {
    font-size: 11px;
    color: #9a8a6a;
    flex: 1;
}
.history-item .h-value {
    font-size: 11px;
    color: #8a6030;
    font-weight: 600;
    flex-shrink: 0;
}

/* ===== 底部 ===== */
.footer {
    position: relative;
    z-index: 1;
    margin-top: 36px;
    padding: 20px;
    text-align: center;
    font-size: 11px;
    color: #c4b8a0;
    letter-spacing: 3px;
}

/* ===== 响应式 ===== */
@media (max-width: 960px) {
    .main-layout {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }
    .col-left,
    .col-right {
        flex: 0 0 auto;
        width: 100%;
        max-width: 520px;
    }
    .history-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .center-card {
        width: 300px;
    }
    .col-left,
    .col-right {
        max-width: 100%;
    }
    .input-wrapper input {
        width: 110px;
        font-size: 22px;
    }
    .number-display { font-size: 38px; }
    .value-amount { font-size: 42px; }
}
