:root {
    --bg-dark: #0f111a;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --danger: #ef4444;
    --success: #10b981;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 动态背景光晕 */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(100px);
}
.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}
.blob-1 {
    top: -10%; left: -10%; width: 50vw; height: 50vw;
    background: radial-gradient(circle, rgba(99,102,241,0.3) 0%, rgba(0,0,0,0) 70%);
}
.blob-2 {
    bottom: -20%; right: -10%; width: 60vw; height: 60vw;
    background: radial-gradient(circle, rgba(168,85,247,0.25) 0%, rgba(0,0,0,0) 70%);
    animation-delay: -5s;
}
.blob-3 {
    top: 40%; left: 50%; width: 40vw; height: 40vw;
    background: radial-gradient(circle, rgba(16,185,129,0.15) 0%, rgba(0,0,0,0) 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 10%) scale(1.1); }
}

/* 毛玻璃通用类 */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.hidden { display: none !important; }

/* 登录模态框 */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.login-panel {
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: fadeInScale 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.login-panel h2 { margin-bottom: 8px; font-weight: 700; }
.login-panel p { color: var(--text-secondary); margin-bottom: 32px; font-size: 0.9rem; }

#login-form { display: flex; flex-direction: column; gap: 16px; }
input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 14px 16px;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}
input:focus { border-color: var(--accent); }

.server-config {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 8px;
    margin-top: 8px;
}
.server-config label { font-size: 0.8rem; color: var(--text-secondary); }

.primary-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin-top: 16px;
}
.primary-btn:hover { background: var(--accent-hover); transform: translateY(-2px); }
.error-msg { color: var(--danger); font-size: 0.85rem; min-height: 20px; }

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    margin-bottom: 40px;
}
.header h1 { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; }
.badge {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    font-weight: 700;
}
.subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-top: 4px; }

.header-right { display: flex; align-items: center; gap: 24px; }
.status-indicator { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 0.85rem;}
.dot {
    width: 8px; height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
}

.icon-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}
.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}
.icon-btn svg { transition: transform 0.5s; }
.icon-btn.spinning svg { animation: spin 1s linear infinite; }

/* 短信列表网格 */
.sms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* 短信卡片 */
.sms-card {
    padding: 24px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}
.sms-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sender { font-weight: 600; font-size: 1.1rem; }
.time { color: var(--text-secondary); font-size: 0.8rem; }

.code-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--accent);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
    user-select: all;
    cursor: pointer;
    transition: color 0.3s;
}
.code-display:hover { color: #fff; }

.full-content {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    word-break: break-all;
}

/* 状态 */
.loading-state, .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 动画 */
@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* 响应式 */
@media (max-width: 768px) {
    .header { flex-direction: column; gap: 20px; text-align: center; padding: 20px; }
    .header-right { flex-direction: column-reverse; gap: 16px; }
    .sms-grid { grid-template-columns: 1fr; }
}
