/* 现代极简 & 科技感核心样式 */
:root {
    /* 基于屏幕宽度的响应式字体系统 */
    font-size: clamp(13px, 2.5vw, 18px);
}

body { 
    background-color: #020617; 
    background-image: 
        radial-gradient(circle at 50% -20%, #1e293b 0%, transparent 50%),
        radial-gradient(circle at 10% 100%, #0f172a 0%, transparent 40%);
    color: #f1f5f9; 
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    overflow-x: hidden; 
    margin: 0;
    padding: 0;
    letter-spacing: -0.01em;
}

/* 布局容器 */
.app-container {
    width: 100%;
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* 大屏响应式限制 */
@media (min-width: 1024px) {
    .app-container {
        border-left: 1px solid rgba(255,255,255,0.03);
        border-right: 1px solid rgba(255,255,255,0.03);
    }
}

/* 磨砂效果背景 */
.modal-bg { 
    background: rgba(2, 6, 23, 0.85); 
    backdrop-filter: blur(25px) saturate(160%); 
}

/* 评分按钮动态交互 */
.score-btn { 
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.score-btn:active { 
    transform: scale(0.9) translateY(2px); 
}

/* 单词卡片网格 - 适配 PC 和 手机 */
.word-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); 
    gap: 1.25rem; 
    width: 100%;
    max-width: 100%;
}

@media (max-width: 768px) {
    .word-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .word-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* 隐藏滚动条 */
.no-scrollbar::-webkit-scrollbar { display: none; }

/* 模态框内部卡片样式 */
.modal-card {
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

/* 分页按钮美化 */
.page-btn-new {
    padding: 0.75rem 1.75rem;
    font-size: 0.85rem;
    font-weight: 900;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
    color: #60a5fa;
    border: 1.5px solid rgba(59, 130, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.page-btn-new:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 10px 30px -10px rgba(37, 99, 235, 0.6);
    transform: translateY(-2px);
}

.page-btn-new:disabled { 
    opacity: 0.2; 
    cursor: not-allowed; 
    transform: none;
}

/* 级别标签容器 - 支持自动换行 */
#statsLevelTabs {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

/* 级别标签按钮美化 */
#statsLevelTabs button {
    flex: 0 0 auto;
    min-width: 80px;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 800;
    border-radius: 1rem;
    color: #64748b;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    margin: 0.35rem;
    background: rgba(59, 130, 246, 0.05);
    border: 1.5px solid rgba(59, 130, 246, 0.15);
}

#statsLevelTabs button:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

#statsLevelTabs button.bg-blue-600 {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
    color: white !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* 动画特效 */
.fade-in { animation: fadeIn 0.4s ease-out; }

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

/* 响应式字体缩放 */
#displayWord {
    line-height: 1.1;
    word-break: break-all;
    text-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* 移动端适配 */
@media (max-width: 640px) {
    :root {
        font-size: 15px;
    }
    
    .word-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    #allWordsContainer > div {
        padding: 1rem;
    }
    
    #filterTabs button {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

/* iPhone 安全区域适配 */
@supports (padding: max(0px)) {
    header { padding-top: max(1rem, env(safe-area-inset-top)); }
    main { padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); }
}

/* 列表条目美化 */
#recentList > div {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 1.25rem;
    padding: 1rem;
    transition: all 0.2s;
}

#recentList > div:hover {
    background: rgba(255,255,255,0.05);
    transform: translateX(4px);
}

/* 全量词本单词卡片样式 */
#allWordsContainer {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

#allWordsContainer > div {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    border: 1.5px solid rgba(59, 130, 246, 0.15);
    border-radius: 1.5rem;
    padding: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px -5px rgba(0, 0, 0, 0.3);
    width: 100%;
    min-width: 0;
}

#allWordsContainer > div:hover {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 1));
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px -15px rgba(37, 99, 235, 0.4);
}

/* 移动端适配 */
@media (max-width: 640px) {
    #allWordsContainer > div {
        padding: 0.6rem;
    }
}

/* 全量词本字体大小调整 */
#allWordsContainer .truncate {
    font-size: 0.875rem;
}

#allWordsContainer .text-xs {
    font-size: 0.7rem;
}

#allWordsContainer .word-score-btn {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.15));
    border: 1.5px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    font-weight: 800;
    transition: all 0.2s;
}

#allWordsContainer .word-score-btn:hover {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 8px 20px -5px rgba(37, 99, 235, 0.5);
}

#allWordsContainer .word-score-btn.active {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 4px 15px -5px rgba(37, 99, 235, 0.4);
}

/* 筛选标签按钮样式 */
#filterTabs button {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 800;
    border-radius: 1rem;
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1.5px solid rgba(59, 130, 246, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#filterTabs button:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

#filterTabs button.bg-blue-600,
#filterTabs button[data-s]:nth-child(1).bg-blue-600 {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
    color: white !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 8px 20px -5px rgba(37, 99, 235, 0.5);
}