/* style.css */

/* --- 基础重置 --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 使用苹果系统默认字体 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    -webkit-font-smoothing: antialiased; 
}

body {
    background-color: #f5f5f7;
    color: #1d1d1f;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* --- 主容器 --- */
.container {
    width: 100%;
    max-width: 600px; 
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px; 
}

/* --- 头部进度 --- */
header {
    text-align: center;
}

header h2 {
    font-size: 1.2rem;
    font-weight: 400;
    color: #86868b; 
}

#progress-text {
    font-weight: 600;
    color: #1d1d1f;
    margin-left: 5px;
}

/* --- 单词卡片核心区域 --- */
.card-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.word-card {
    background-color: #ffffff;
    padding: 50px 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

/* --- 单词和喇叭的头部排版 (已修复绝对居中对齐) --- */
.word-header {
    display: flex;
    align-items: center;    /* 强制垂直居中 */
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
}

/* 单词文本 */
#word-display {
    font-size: 3.5rem; 
    font-weight: 700;
    letter-spacing: -0.02em; 
    line-height: 1;         /* 消除文字上下的隐形留白 */
    margin: 0;              /* 彻底清除标题默认的外边距 */
    user-select: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
}

/* 单词文本点击反馈 (保留 active) */
#word-display:active {
    transform: scale(0.95);
    opacity: 0.7;
}

/* 喇叭图标 */
.speak-btn {
    background: transparent;
    border: none;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0071e3;
    transition: opacity 0.2s, transform 0.2s;
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent;
    
    position: relative;
    top: 6px; 
}

/* 喇叭点击反馈 (保留 active) */
.speak-btn:active {
    opacity: 0.5;
    transform: scale(0.9);
}

.speak-btn svg {
    width: 28px;
    height: 28px;
}

/* 释义文本 */
#meaning-display {
    font-size: 1.5rem;
    color: #515154;
    margin-bottom: 25px;
    font-weight: 400;
}

/* 联动查词网站的链接按钮 */
.dict-btn {
    display: inline-block;
    text-decoration: none;
    color: #0071e3; 
    font-size: 0.9rem;
    padding: 8px 16px;
    background-color: rgba(0, 113, 227, 0.05); 
    border-radius: 20px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.dict-btn:active {
    transform: scale(0.97);
    opacity: 0.8;
}

/* --- 操作按钮区域 --- */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    min-height: 50px; 
}

/* 统一定义通用按钮样式 */
button {
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 1.05rem; 
    font-weight: 600;   
    padding: 14px 24px;
    border-radius: 14px; 
    transition: transform 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent; 
}

/* 所有大按钮的点击物理反馈 */
button:active {
    transform: scale(0.95); 
    opacity: 0.6; 
}

/* “看答案”主按钮 */
#btn-show-meaning {
    background-color: #0071e3; 
    color: #ffffff;
    width: 100%; 
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.2); 
}

/* “认识/不认识”按钮组 */
#judge-buttons {
    display: flex;
    gap: 15px;
    width: 100%;
    justify-content: center;
}

#judge-buttons button {
    flex: 1; 
    max-width: 150px;
}

/* “不认识” - 苹果原生红 */
.btn-red {
    background-color: #FF3B30;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.2); 
}

/* “认识” - 苹果原生绿 */
.btn-green {
    background-color: #34C759;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.2); 
}

/* --- 打卡记录区域 --- */
.punch-card-section {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.punch-card-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1d1d1f;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr); 
    gap: 8px;
}

.calendar-day {
    aspect-ratio: 1; /* 保持宽高相等（正方形基础） */
    background-color: #f5f5f7;
    
    border-radius: 50%; 
    
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #86868b;
}

.calendar-day.active {
    background-color: #C2DFFF;
    color: #ffffff;
    font-weight: 600;
}

/* --- 工具类 --- */
.hidden {
    display: none !important;
}


/* --- 任务完成状态专属排版 (视觉居中修复) --- */
#word-display.finished-title {
    font-size: 2.2rem;       
    line-height: 1.4;        
    margin-bottom: 10px;     
    cursor: default;         
    
    display: block;          
    width: 100%;             
    text-align: center;      
    
    /* === 抵消 Emoji 占位导致的视觉偏移 === */
    /* 强行把整个元素向左拉回 18 个像素，让汉字回归视觉正中心 */
    transform: translateX(-18px); 
}

#word-display.finished-title:active {
    /* 保持左移，同时取消点击缩放动画 */
    transform: translateX(-18px); 
    opacity: 1;
}

#meaning-display.finished-subtitle {
    font-size: 1.1rem;       
    line-height: 1.6;        
    color: #86868b;          
    text-align: center;
}
