﻿/* ==================== 全局样式 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #a855f7;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 24px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 48px rgba(0,0,0,0.1);
    --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==================== 页面切换 ==================== */
.page { display: none; animation: fadeIn 0.5s ease; }
.page.active { display: block; }

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

/* ==================== 首页 ==================== */
.home-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 60px 20px 40px;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home-header { margin-bottom: 40px; }
.logo-icon { margin-bottom: 20px; }
.logo-icon svg { width: 60px; height: 60px; }

.home-title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.home-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 420px;
    margin: 0 auto;
}

/* 输入区域 */
.input-section { margin-bottom: 36px; }

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: var(--shadow-lg);
    border: 2px solid transparent;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 12px 48px rgba(99,102,241,0.15);
}

.url-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 14px 16px;
    background: transparent;
    color: var(--text);
    min-width: 0;
}

.url-input::placeholder { color: var(--text-muted); }

.btn-analyze {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

.btn-analyze:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}

.btn-analyze:active { transform: scale(0.98); }
.btn-icon { font-size: 18px; }
.input-hint { font-size: 13px; color: var(--text-muted); margin-top: 12px; }

/* 信任数据 */
.trust-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.trust-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    min-width: 140px;
    transition: var(--transition);
}

.trust-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.trust-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trust-label { font-size: 13px; color: var(--text-secondary); display: block; margin-top: 4px; }

.home-footer { margin-top: auto; padding-top: 40px; }
.home-footer p { font-size: 13px; color: var(--text-muted); }

/* ==================== 分析过程页 ==================== */
.analyzing-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 80px 20px;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.analyzing-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 36px;
}

.pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid var(--primary-light);
    animation: pulse 2s ease-out infinite;
    opacity: 0;
}

.pulse-ring.delay-1 { animation-delay: 0.4s; }
.pulse-ring.delay-2 { animation-delay: 0.8s; }

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.2); opacity: 0; }
}

.center-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: breathe 2s ease-in-out infinite;
}

.center-icon svg { width: 56px; height: 56px; }

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.analyzing-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 32px;
    color: var(--text);
}

.steps-container { text-align: left; width: 100%; max-width: 320px; }

.step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    opacity: 0.35;
    transition: var(--transition);
}

.step-item.active { opacity: 1; }
.step-item.done { opacity: 0.8; }
.step-item.done .step-dot { background: var(--success); border-color: var(--success); }

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--primary-light);
    flex-shrink: 0;
    transition: var(--transition);
}

.step-item.active .step-dot {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(99,102,241,0.5);
    animation: dotPulse 1s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(99,102,241,0.4); }
    50% { box-shadow: 0 0 20px rgba(99,102,241,0.7); }
}

.step-text { font-size: 15px; color: var(--text-secondary); }
.step-item.active .step-text { color: var(--text); font-weight: 500; }

/* ==================== 结果页 ==================== */
.result-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 20px 80px;
}

.result-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.section-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--text); }

/* 评分区域 */
.score-section { text-align: center; padding: 36px 24px; }

.score-ring-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
}

.score-ring { width: 100%; height: 100%; transform: rotate(-90deg); }

.ring-progress {
    stroke-dasharray: 534;
    stroke-dashoffset: 534;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4,0,0.2,1);
}

.score-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-number { font-size: 56px; font-weight: 800; color: var(--primary); }
.score-label { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

.score-level {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(168,85,247,0.1) 100%);
    color: var(--primary);
}

/* 账号信息标签 */
.info-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.info-tag {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.info-tag.highlight {
    background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(168,85,247,0.08) 100%);
    color: var(--primary);
    border-color: rgba(99,102,241,0.2);
}

/* 数据卡片 */
.data-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.data-card {
    text-align: center;
    padding: 16px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    transition: var(--transition);
}

.data-card:hover { background: rgba(99,102,241,0.04); }

.data-card .card-icon { font-size: 24px; margin-bottom: 8px; }
.data-card .card-value { font-size: 20px; font-weight: 700; color: var(--text); }
.data-card .card-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* 雷达图 */
.radar-container {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

/* 内容标签 */
.content-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.content-tag {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(168,85,247,0.08) 100%);
    color: var(--primary);
    border: 1px solid rgba(99,102,241,0.15);
}

/* 分析列表 */
.analysis-list { list-style: none; padding: 0; }

.analysis-list li {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.5;
}

.strengths li { background: rgba(16,185,129,0.06); color: #065f46; }
.strengths li::before { content: "✅ "; }

.problems li { background: rgba(245,158,11,0.06); color: #92400e; }
.problems li::before { content: "🔍 "; }

.suggestions li { background: rgba(99,102,241,0.06); color: #3730a3; }
.suggestions li::before { content: "💡 "; }

/* 商业转化 */
.commercial-section { margin-top: 8px; }

.commercial-card {
    text-align: center;
    padding: 28px 20px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(99,102,241,0.04) 0%, rgba(168,85,247,0.04) 100%);
    border: 2px dashed rgba(99,102,241,0.2);
}

.commercial-icon { font-size: 40px; margin-bottom: 12px; }
.commercial-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.commercial-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }

.btn-commercial {
    display: inline-block;
    padding: 14px 36px;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    color: white;
    border: none;
    border-radius: 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(245,158,11,0.3);
}

.btn-commercial:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(245,158,11,0.45);
}

/* 底部操作 */
.result-actions { text-align: center; padding: 16px 0 40px; }

.btn-retry {
    padding: 12px 32px;
    border: 2px solid var(--border);
    border-radius: 24px;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-retry:hover { border-color: var(--primary-light); color: var(--primary); }

/* Toast */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #1e293b;
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ==================== 移动端适配 ==================== */
@media (max-width: 480px) {
    .home-container { padding: 40px 16px 30px; }
    .home-title { font-size: 24px; }

    .input-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    .url-input { padding: 12px 14px; }
    .btn-analyze { width: 100%; justify-content: center; padding: 14px; }

    .trust-section { gap: 10px; }
    .trust-card { min-width: auto; flex: 1; padding: 14px 12px; }
    .trust-number { font-size: 22px; }

    .data-cards { grid-template-columns: repeat(2, 1fr); }

    .result-container { padding: 16px 12px 70px; }
    .result-section { padding: 20px 16px; }

    .score-number { font-size: 48px; }
    .score-ring-container { width: 160px; height: 160px; }
}

@media (min-width: 768px) {
    .home-container { padding: 80px 20px 60px; }
}

/* 倒计时 */
.countdown-section { text-align: center; margin-top: 24px; }
.countdown-bar-wrap {
    width: 80%; max-width: 320px; height: 6px;
    background: #e2e8f0; border-radius: 3px; margin: 0 auto 10px; overflow: hidden;
}
.countdown-bar {
    height: 100%; width: 0%; border-radius: 3px;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    transition: width 1s linear;
}
.countdown-text { font-size: 14px; color: #64748b; }
.countdown-text b { color: #6366f1; font-size: 18px; }
/* 用户信息 */
.user-info-section { text-align: center; padding: 12px 24px 16px; }
.user-info-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #6366f1; object-fit: cover; }
.user-nickname { font-size: 16px; font-weight: 600; color: #1e293b; }