/* index.css */
:root {
    --bg-dark: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.4);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-fire: #f59e0b;
    --accent-map: #10b981;
    --accent-time: #8b5cf6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* 动态背景光斑 */
.background-blobs {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: move 20s infinite alternate;
}
.blob-1 { top: -10%; left: -10%; width: 60vw; height: 60vw; background: var(--primary); }
.blob-2 { bottom: -10%; right: -10%; width: 50vw; height: 50vw; background: var(--accent-time); animation-delay: -5s; }

@keyframes move {
    from { transform: translate(0, 0); }
    to { transform: translate(10%, 10%); }
}

/* 容器布局 */
.main-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 头部与语言切换 */
.app-header { text-align: center; margin-bottom: 10px; }
.header-top { display: flex; justify-content: flex-end; margin-bottom: 10px; }

.language-selector {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}
.language-selector select {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
}
.language-selector select option { background: var(--bg-dark); }

.logo-area { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 8px; }
.logo-area h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.5px; }
.app-header p { color: var(--text-muted); font-size: 0.95rem; }

/* 通用毛玻璃面板 */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* 搜索组件 */
.search-panel { display: flex; flex-direction: column; gap: 16px; }
.input-group {
    display: flex; align-items: center;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 16px;
    padding: 0 16px;
    border: 1px solid var(--glass-border);
    transition: border-color 0.3s;
}
.input-group:focus-within { border-color: var(--primary); }
.input-group input {
    flex: 1; background: transparent; border: none; color: white;
    padding: 16px 12px; font-size: 1rem; outline: none;
}
.search-icon { color: var(--text-muted); }
.icon-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 5px; font-size: 1.2rem; }

.cta-btn {
    background: var(--primary);
    color: white; border: none; border-radius: 16px;
    padding: 16px; font-size: 1.1rem; font-weight: 600;
    cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: transform 0.2s, background 0.2s;
}
.cta-btn:hover { background: #2563eb; transform: translateY(-1px); }
.cta-btn:active { transform: translateY(0); }

/* 结果卡片 */
.profile-header { display: flex; align-items: center; gap: 20px; }
.avatar-frame {
    width: 85px; height: 85px; border-radius: 50%;
    border: 3px solid var(--primary);
    padding: 3px; background: rgba(0,0,0,0.2);
}
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.player-name { font-size: 1.6rem; margin-bottom: 6px; }
.uid-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.08); padding: 5px 14px;
    border-radius: 20px; font-size: 0.9rem; color: var(--text-muted); cursor: pointer;
}
.uid-badge:hover { background: rgba(255,255,255,0.15); color: white; }

/* 统计数据 Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.stat-card {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 18px 10px;
}
.stat-icon { font-size: 1.4rem; margin-bottom: 10px; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 5px; letter-spacing: 0.5px; }
.stat-value { font-size: 1.2rem; font-weight: 700; color: white; }
.stat-value img { height: 22px; vertical-align: middle; margin-left: 4px; }
.small-text { font-size: 0.85rem; word-break: break-word; }

/* 历史记录 */
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.text-btn { background: none; border: none; color: var(--primary); cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.history-list { display: flex; flex-direction: column; gap: 10px; max-height: 280px; overflow-y: auto; }
.history-item {
    display: flex; align-items: center; gap: 15px;
    background: rgba(255,255,255,0.03); padding: 12px 16px;
    border-radius: 16px; cursor: pointer; transition: background 0.2s;
}
.history-item:hover { background: rgba(255,255,255,0.08); }
.h-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1px solid var(--glass-border); }
.h-info { flex: 1; }
.h-name { font-weight: 600; font-size: 1rem; margin-bottom: 2px; }
.h-uid { font-size: 0.85rem; color: var(--text-muted); }
.h-time { font-size: 0.75rem; color: var(--text-muted); opacity: 0.6; }

/* 响应式调整 */
@media (max-width: 500px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { flex-direction: row; justify-content: space-between; padding: 15px 20px; }
    .stat-content { text-align: right; }
    .stat-icon { margin-bottom: 0; }
    .logo-area h1 { font-size: 1.5rem; }
}

/* RTL 阿拉伯语适配 */
[dir="rtl"] .logo-area, [dir="rtl"] .input-group, [dir="rtl"] .history-item {
    flex-direction: row-reverse;
}
[dir="rtl"] .stat-value img { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .language-selector { flex-direction: row-reverse; }

/* 加载动画 */
.loading-container { display: none; text-align: center; padding: 10px; }
.spinner {
    width: 30px; height: 30px; border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary); border-radius: 50%;
    margin: 0 auto; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast 消息 */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: #1e293b; color: white; padding: 12px 24px;
    border-radius: 50px; border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 9999; opacity: 0; transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, -10px); }
.toast.error { border-bottom: 3px solid var(--accent-fire); }
.toast.success { border-bottom: 3px solid var(--accent-map); }
