/**
 * 查一查 · chayicha.ai
 * Digital Identity Security Platform
 * Version: 1.0
 */

/* ========== CSS 变量 ========== */
:root {
    --bg: #0a0a0f;
    --bg-elevated: #0e0e14;
    --card: #13131a;
    --card-hover: #1a1a24;
    --border: #1e1e2a;
    --border-light: #2a2a3a;
    --text: #f0f0f5;
    --text-secondary: #c8c8d0;
    --muted: #6e6e80;

    --primary: #6366f1;
    --primary-hover: #5558e6;
    --primary-light: rgba(99,102,241,0.12);
    --primary-glow: rgba(99,102,241,0.25);

    --green: #22c55e;
    --green-light: rgba(34,197,94,0.12);
    --red: #ef4444;
    --red-light: rgba(239,68,68,0.12);
    --orange: #f59e0b;
    --orange-light: rgba(245,158,11,0.12);
    --cyan: #06b6d4;
    --cyan-light: rgba(6,182,212,0.12);

    --radius: 8px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --font-sans: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
    --font-mono: 'SF Mono', Monaco, Consolas, monospace;
}

/* ========== 重置 ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
::selection { background: var(--primary); color: #fff; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

/* ========== 首页布局 ========== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* 背景网格 */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 50% 30%, var(--primary-glow) 0%, transparent 50%),
        linear-gradient(rgba(99,102,241,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,0.03) 1px, transparent 1px);
    background-size: 100% 100%, 60px 60px, 60px 60px;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 680px;
    width: 100%;
}

/* Logo */
.logo {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: .5rem;
}
.logo-accent { color: var(--primary); }

.tagline {
    font-size: 1.05rem;
    color: var(--muted);
    margin-bottom: 2.5rem;
    font-weight: 400;
}

/* ========== 搜索框 ========== */
.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    padding: 1.1rem 1.5rem;
    padding-right: 130px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    color: var(--text);
    font-size: 1.05rem;
    outline: none;
    transition: all .2s;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: .75rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: calc(var(--radius-xl) - 4px);
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.search-btn:hover { background: var(--primary-hover); }
.search-btn:disabled { opacity: .5; cursor: not-allowed; }
.search-btn i { font-size: .9rem; }

/* 输入类型提示 */
.input-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    font-size: .82rem;
    color: var(--muted);
    margin-bottom: 2rem;
}
.input-hint span { display: flex; align-items: center; gap: .35rem; }
.input-hint i { font-size: .75rem; }

/* 类型自动检测标签 */
.detected-type {
    position: absolute;
    left: 1.5rem;
    top: -10px;
    font-size: .7rem;
    padding: .15rem .55rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    display: none;
}
.detected-type.show { display: inline-block; }
.detected-type.phone { background: var(--green-light); color: var(--green); }
.detected-type.email { background: var(--cyan-light); color: var(--cyan); }
.detected-type.username { background: var(--primary-light); color: var(--primary); }
.detected-type.ip { background: var(--red-light); color: var(--red); }

/* ========== 功能卡片 ========== */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 680px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: left;
    transition: all .2s;
}
.feature-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}
.feature-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    margin-bottom: .75rem;
}
.feature-title {
    font-size: .88rem;
    font-weight: 600;
    margin-bottom: .3rem;
}
.feature-desc {
    font-size: .75rem;
    color: var(--muted);
    line-height: 1.5;
}

/* ========== 结果页 ========== */
.results-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.results-header .logo { font-size: 1.3rem; cursor: pointer; }
.results-back { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: .35rem; }
.results-back:hover { color: var(--text); }

/* 风险评分 */
.risk-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.risk-score {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.risk-score-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.risk-score-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .5px; margin-top: .2rem; }

.risk-low { border: 3px solid var(--green); }
.risk-low .risk-score-value { color: var(--green); }
.risk-medium { border: 3px solid var(--orange); }
.risk-medium .risk-score-value { color: var(--orange); }
.risk-high { border: 3px solid var(--red); }
.risk-high .risk-score-value { color: var(--red); }

.risk-summary { flex: 1; }
.risk-summary h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: .35rem; }
.risk-summary p { font-size: .85rem; color: var(--muted); }

.risk-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: .75rem;
}
.risk-stat-value { font-size: 1.3rem; font-weight: 700; }
.risk-stat-label { font-size: .72rem; color: var(--muted); }

/* 统计卡片 */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}
.stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-label { font-size: .72rem; color: var(--muted); margin-top: .2rem; }

/* 平台结果列表 */
.platform-section {
    margin-bottom: 1.5rem;
}
.platform-section-head {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: .75rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--border);
}

.platform-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .75rem;
    border-radius: var(--radius);
    transition: background .1s;
}
.platform-item:hover { background: rgba(255,255,255,.02); }

.platform-favicon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    color: var(--muted);
    flex-shrink: 0;
    overflow: hidden;
}
.platform-favicon img { width: 100%; height: 100%; object-fit: cover; }

.platform-name { font-weight: 500; font-size: .88rem; flex: 1; }
.platform-url { font-size: .75rem; color: var(--muted); font-family: var(--font-mono); }

.platform-status {
    font-size: .72rem;
    padding: .2rem .55rem;
    border-radius: 4px;
    font-weight: 500;
}
.status-found { background: var(--green-light); color: var(--green); }
.status-not-found { background: rgba(255,255,255,.04); color: var(--muted); }
.status-error { background: var(--orange-light); color: var(--orange); }

/* ========== 扫描动画 ========== */
.scanning-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,10,15,.92);
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.5rem;
}
.scanning-overlay.show { display: flex; }

.scan-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.scan-status { font-size: .95rem; color: var(--text-secondary); }
.scan-progress { font-size: .8rem; color: var(--muted); }
.scan-log {
    max-width: 500px;
    width: 90%;
    max-height: 200px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: .75rem;
    color: var(--muted);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem;
    line-height: 1.8;
}
.scan-log .hit { color: var(--green); }
.scan-log .miss { color: var(--muted); opacity: .4; }

/* ========== 页脚 ========== */
.footer {
    position: relative;
    z-index: 1;
    margin-top: 3rem;
    text-align: center;
    font-size: .75rem;
    color: var(--muted);
}
.footer a { color: var(--primary); }
.footer a:hover { text-decoration: underline; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .hero { padding: 1.5rem; }
    .logo { font-size: 2rem; }
    .search-input { font-size: .95rem; padding: 1rem 1.25rem; padding-right: 110px; }
    .search-btn { padding: .65rem 1.1rem; font-size: .85rem; }
    .features { grid-template-columns: repeat(2, 1fr) !important; }
    .input-hint { flex-wrap: wrap; gap: .75rem; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .risk-card { flex-direction: column; text-align: center; }
    .risk-stats { justify-content: center; }
    .platform-url { display: none; }
}
