/* ===== 全局重置 & 基础 ===== */
* {
    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;
}

/* ===== 输入区域 ===== */
.input-section {
    position: relative;
    z-index: 1;
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.input-section .hint {
    font-size: 13px;
    color: #b0a080;
    letter-spacing: 3px;
}
.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;
}
.input-wrapper:focus-within {
    border-color: #c4a265;
    box-shadow: 0 0 16px rgba(196, 162, 101, 0.2);
}
.input-wrapper .prefix {
    padding: 0 8px 0 16px;
    color: #b0a080;
    font-size: 14px;
    letter-spacing: 1px;
    user-select: none;
}
.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;
}
.input-wrapper input::placeholder {
    color: #d4c8b0;
    letter-spacing: 4px;
    font-size: 16px;
}
.input-wrapper input::-webkit-outer-spin-button,
.input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.input-wrapper input[type=number] {
    -moz-appearance: textfield;
}

.btn-divine {
    margin-top: 4px;
    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;
}
.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;
}
.btn-divine:hover::before {
    opacity: 1;
}
.btn-divine:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(196, 162, 101, 0.35);
}
.btn-divine:active {
    transform: translateY(0);
}
.btn-divine:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* ===== 卡片容器 ===== */
.card-container {
    position: relative;
    z-index: 1;
    margin-top: 36px;
    perspective: 1200px;
    width: 340px;
    height: 480px;
}

/* ===== 卡片翻转 ===== */
.card {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.9s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
}
.card.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
}

/* ===== 卡片正面 (未翻转时的图案) ===== */
.card-front {
    background: linear-gradient(145deg, #faf5ea, #f0e8d8);
    border: 1px solid #d4c4a8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(106, 74, 42, 0.08);
}
.card-front .pattern {
    position: relative;
    width: 160px;
    height: 160px;
}
.card-front .pattern .ring {
    position: absolute;
    border: 1px solid #d4c4a8;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.card-front .pattern .ring:nth-child(1) { width: 160px; height: 160px; }
.card-front .pattern .ring:nth-child(2) { width: 120px; height: 120px; }
.card-front .pattern .ring:nth-child(3) { width: 80px; height: 80px; }
.card-front .pattern .ring:nth-child(4) { width: 40px; height: 40px; }

.card-front .pattern .center-symbol {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: #c4a265;
    opacity: 0.4;
}
.card-front .flip-hint {
    margin-top: 30px;
    font-size: 13px;
    color: #b0a080;
    letter-spacing: 4px;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.9; }
}

/* ===== 卡片背面 (估值结果) ===== */
.card-back {
    background: linear-gradient(145deg, #faf5ea, #f0e8d8);
    border: 1px solid #d4c4a8;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 24px;
    box-shadow: 0 4px 24px rgba(106, 74, 42, 0.08);
}

/* 顶部装饰线 */
.card-back .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;
}

/* 底部装饰 */
.card-back .bottom-line {
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(196, 162, 101, 0.3), transparent);
    margin-top: auto;
    margin-bottom: 8px;
}
.card-back .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-section {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    margin-top: 32px;
    padding: 0 20px;
    display: none;
}
.analysis-section.visible {
    display: block;
    animation: fadeUp 0.6s ease;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.analysis-panel {
    background: rgba(255, 252, 245, 0.85);
    border: 1px solid #d4c4a8;
    border-radius: 10px;
    padding: 22px 24px;
    box-shadow: 0 2px 16px rgba(106, 74, 42, 0.06);
}

.analysis-title {
    text-align: center;
    font-size: 14px;
    color: #8a7a5a;
    letter-spacing: 4px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8ddd0;
}

/* 总分条 */
.score-bar-wrap {
    margin-bottom: 16px;
}
.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: 8px;
}
.analysis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    border-radius: 4px;
    background: rgba(255, 252, 245, 0.6);
    border: 1px solid #ede5d8;
    font-size: 13px;
    color: #5a4a30;
    letter-spacing: 1px;
}
.analysis-item .item-label {
    display: flex;
    align-items: center;
    gap: 6px;
}
.analysis-item .item-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #c4a265;
}
.analysis-item .item-score {
    font-weight: 700;
    color: #8a6030;
    font-size: 14px;
    white-space: nowrap;
}
.analysis-item .item-score.positive {
    color: #7a8a3a;
}
.analysis-item .item-score.negative {
    color: #9a6a4a;
}

/* 无匹配提示 */
.analysis-empty {
    text-align: center;
    color: #b0a080;
    font-size: 12px;
    letter-spacing: 2px;
    padding: 10px 0;
}

/* 热门尾号参考 */
.hot-section {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    margin-top: 24px;
    padding: 0 20px;
}
.hot-title {
    text-align: center;
    font-size: 12px;
    color: #b0a080;
    letter-spacing: 3px;
    margin-bottom: 12px;
}
.hot-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.hot-tag {
    padding: 5px 14px;
    border: 1px solid #d4c4a8;
    border-radius: 4px;
    font-size: 13px;
    color: #6a5a3a;
    background: rgba(255, 252, 245, 0.6);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 2px;
}
.hot-tag:hover {
    border-color: #c4a265;
    background: rgba(196, 162, 101, 0.1);
}

/* ===== 历史记录 ===== */
.history-section {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    margin-top: 28px;
    padding: 0 20px;
}
.history-title {
    text-align: center;
    font-size: 12px;
    color: #b0a080;
    letter-spacing: 3px;
    margin-bottom: 10px;
}
.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.history-empty {
    color: #c4b8a0;
    font-size: 12px;
    letter-spacing: 2px;
    padding: 6px 0;
}
.history-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 4px 10px;
    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;
}
.history-item .h-rank {
    font-size: 11px;
    color: #9a8a6a;
}
.history-item .h-value {
    font-size: 11px;
    color: #8a6030;
    font-weight: 600;
}

/* ===== 底部 ===== */
.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: 480px) {
    .card-container {
        width: 300px;
        height: 440px;
    }
    .input-wrapper input {
        width: 110px;
        font-size: 22px;
    }
    .number-display { font-size: 38px; }
    .value-amount { font-size: 42px; }
    .analysis-panel { padding: 16px; }
}
