/* ========== 苹果风格设计系统 ========== */
:root {
    /* 色彩系统 */
    --apple-bg: #f5f5f7;
    --apple-card-bg: #ffffff;
    --apple-primary: #007aff;
    --apple-primary-light: rgba(0, 122, 255, 0.1);
    --apple-secondary: #5856d6;
    --apple-success: #34c759;
    --apple-warning: #ff9500;
    --apple-danger: #ff3b30;
    --apple-gray-1: #8e8e93;
    --apple-gray-2: #c7c7cc;
    --apple-gray-3: #e5e5ea;
    --apple-gray-4: #f2f2f7;
    
    /* 阴影系统 */
    --apple-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --apple-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --apple-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* 过渡动画 */
    --apple-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --apple-transition-fast: all 0.15s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* 文本颜色 */
    --text-primary: #1d1d1f;
    --text-secondary: #424245;
    --text-tertiary: #8e8e93;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--apple-bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ========== 页面容器 ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== 页面头部 ========== */
.header {
    text-align: center;
    padding: 60px 20px 40px;
    background: linear-gradient(135deg, var(--apple-primary) 0%, var(--apple-secondary) 100%);
    border-radius: 20px;
    margin-bottom: 30px;
    color: white;
    position: relative;
    box-shadow: var(--apple-shadow-md);
}

/* ========== 标题区域 ========== */
.panda-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.panda-title h1 {
    font-size: 48px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    font-family: 'Comic Neue', 'Inter', sans-serif;
}

.panda-emoji {
    font-size: 4rem;
    animation: bounce 2s infinite;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.header p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

/* ========== 按钮系统 ========== */
.download-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--apple-success);
    color: white;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: var(--apple-transition-fast);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
}

.download-btn:hover {
    background: #30b453;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 199, 89, 0.4);
}

.bottom-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* ========== 主要按钮样式 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 16px;
    transition: var(--apple-transition-fast);
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--apple-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.btn-primary:hover {
    background: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3);
}

.share-btn-bottom, .download-btn-bottom {
    padding: 15px 35px;
    border-radius: 16px;
    font-size: 1.1rem;
    box-shadow: var(--apple-shadow-md);
}

.share-btn-bottom {
    background: var(--apple-success);
}

.share-btn-bottom:hover {
    background: #30b453;
    transform: translateY(-2px);
}

.download-btn-bottom {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
}

.download-btn-bottom:hover {
    background: linear-gradient(135deg, #ff8e8e, #ff6b6b);
    transform: translateY(-2px);
}

/* ========== 过滤器和搜索 ========== */
.filters-container {
    background: var(--apple-card-bg);
    padding: 30px;
    border-radius: 18px;
    margin-bottom: 30px;
    box-shadow: var(--apple-shadow-sm);
    border: 1px solid var(--apple-gray-3);
}

.filter-group {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-item {
    flex: 1;
    min-width: 250px;
}

.filter-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--apple-primary);
    font-size: 15px;
}

.filter-select, .search-input {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid var(--apple-gray-3);
    border-radius: 12px;
    font-size: 16px;
    background: var(--apple-card-bg);
    color: var(--text-primary);
    transition: var(--apple-transition-fast);
    font-family: 'Inter', sans-serif;
}

.filter-select:focus, .search-input:focus {
    outline: none;
    border-color: var(--apple-primary);
    box-shadow: 0 0 0 3px var(--apple-primary-light);
}

.search-item {
    position: relative;
}

.search-input {
    padding-left: 50px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23007aff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 18px center;
}

.search-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--apple-gray-2);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: var(--apple-transition-fast);
}

.search-clear:hover {
    color: var(--apple-danger);
}

.stats {
    margin-top: 20px;
    padding: 10px;
    text-align: center;
    color: var(--apple-primary);
    font-weight: 600;
    font-size: 16px;
    background: var(--apple-gray-4);
    border-radius: 12px;
}

/* ========== 控制栏 ========== */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: var(--apple-card-bg);
    padding: 20px 30px;
    border-radius: 16px;
    box-shadow: var(--apple-shadow-sm);
    border: 1px solid var(--apple-gray-3);
}

.pagination-info {
    font-weight: 600;
    color: var(--apple-primary);
    font-size: 16px;
}

.pagination-controls {
    display: flex;
    gap: 12px;
}

/* ========== 闪卡网格 ========== */
.flashcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* ========== 闪卡翻转效果 ========== */
.flashcard {
    perspective: 1000px;
    height: 380px;
    width: 100%;
    background: transparent;
    border-radius: 18px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-style: preserve-3d;
    border-radius: 18px;
    box-shadow: var(--apple-shadow-md);
    border: 1px solid var(--apple-gray-3);
}

.flashcard-inner.flipped {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 8px;
}

.flashcard-front {
    background: var(--apple-card-bg);
    justify-content: space-between;
}

.flashcard-back {
    background: var(--apple-card-bg);
    transform: rotateY(180deg);
    justify-content: space-between;
}

/* 闪卡顶部装饰条 */
.flashcard-front::before, .flashcard-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--apple-primary), var(--apple-secondary));
}

.flashcard-back::before {
    background: linear-gradient(90deg, var(--apple-success), #30b453);
}

/* ========== 闪卡内容样式 ========== */
.flashcard-emoji, .flashcard-emoji-back {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 4px;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.1));
}

.flashcard-word-section, .flashcard-translation-section {
    text-align: center;
    margin-bottom: 12px;
    align-items: center;
    justify-content: center;
}

.flashcard-word, .flashcard-word-back {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: 'Comic Neue', 'Inter', sans-serif;
}

.flashcard-pronunciation {
    font-size: 1.2rem;
    color: var(--apple-primary);
    font-weight: 600;
    font-family: 'Comic Neue', 'Inter', sans-serif;
    display: flex;
    align-items: center; /* 自身内容垂直居中 */
    margin: 0;
}

.flashcard-pos {
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* 让元素在父容器中居中 */
    margin-left: auto;
    margin-right: auto;
    
    background: var(--apple-primary-light);
    padding: 8px 18px; 
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 12px;
    width: fit-content; 
    min-width: min-content;

}

.flashcard-translation {
    font-size: 1.8rem;
    color: var(--apple-secondary);
    font-weight: 700;
    margin-bottom: 15px;
    font-family: 'Comic Neue', 'Inter', sans-serif;
}

.flashcard-definition, .flashcard-definition-back {
    color: var(--text-primary);
    font-size: 1.2rem;
    line-height: 1.4;
    text-align: center;
    margin-bottom: 20px;
    margin-left: 6px;
    margin-right: 6px;
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    
    /* 优化文本换行 */
    word-break: break-word; 
    hyphens: auto; 
    overflow-wrap: break-word; 
    text-overflow: ellipsis;
    display: block;
    overflow: hidden;
    white-space: normal;
}

/* 闪卡底部信息 */
.flashcard-details {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--apple-gray-3);
    font-size: 14px;
    color: var(--text-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grade-badge, .unit-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.flip-hint, .flip-hint-back {
    margin-top: 15px;
    font-size: 13px;
    color: var(--text-tertiary);
    opacity: 0.8;
}

/* ========== 详情按钮 ========== */
.detail-btn {
    background: var(--apple-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--apple-transition-fast);
    width: 80%;
    max-width: 200px;
    margin: 15px auto 20px;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.detail-btn:hover {
    background: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3);
}

/* ========== 卡片颜色变体 ========== */
/* 主色调闪卡 */
.card-color-1 { 
    background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.05), 
        rgba(0, 122, 255, 0.02)
    );
    border-color: rgba(0, 122, 255, 0.15);
}

.card-color-2 { 
    background: linear-gradient(135deg, 
        rgba(88, 86, 214, 0.05), 
        rgba(88, 86, 214, 0.02)
    );
    border-color: rgba(88, 86, 214, 0.15);
}

/* 成功/积极色调闪卡 */
.card-color-3 { 
    background: linear-gradient(135deg, 
        rgba(52, 199, 89, 0.05), 
        rgba(52, 199, 89, 0.02)
    );
    border-color: rgba(52, 199, 89, 0.15);
}

/* 警告/注意色调闪卡 */
.card-color-4 { 
    background: linear-gradient(135deg, 
        rgba(255, 149, 0, 0.05), 
        rgba(255, 149, 0, 0.02)
    );
    border-color: rgba(255, 149, 0, 0.15);
}

/* 强调/重要色调闪卡 */
.card-color-5 { 
    background: linear-gradient(135deg, 
        rgba(255, 59, 48, 0.05), 
        rgba(255, 59, 48, 0.02)
    );
    border-color: rgba(255, 59, 48, 0.15);
}

/* 中性/基础色调闪卡 */
.card-color-6 { 
    background: linear-gradient(135deg, 
        var(--apple-gray-4), 
        var(--apple-card-bg)
    );
    border-color: var(--apple-gray-3);
}

/* ========== 每日单词卡片 ========== */
.daily-word-banner {
    margin: 30px auto;
    max-width: 1200px;
}

.daily-word-container {
    position: relative;
    background: linear-gradient(135deg, var(--apple-primary) 0%, var(--apple-secondary) 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--apple-shadow-lg);
    overflow: hidden;
    color: white;
    position: relative;
    z-index: 1;
}

.daily-word-bg-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    animation: float 20s infinite ease-in-out;
}

/* ========== 详情模态框 ========== */
.flashcard-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.flashcard-detail {
    max-width: 800px;
    margin: 40px auto;
    background: var(--apple-card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--apple-shadow-lg);
    position: relative;
    animation: fadeIn 0.3s ease;
}

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

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--apple-danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--apple-transition-fast);
}

.close-btn:hover {
    background: #e83e3e;
    transform: scale(1.1);
}

/* ========== 详情页面样式 ========== */
.detail-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--apple-gray-3);
}

.detail-emoji {
    font-size: 4rem;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.1));
}

.detail-word-section {
    flex: 1;
}

.detail-word-line {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.detail-word {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Comic Neue', 'Inter', sans-serif;
}

.detail-pronunciation {
    font-size: 1.5rem;
    color: var(--apple-primary);
    font-weight: 600;
    font-family: 'Comic Neue', 'Inter', sans-serif;
}

.detail-translation {
    font-size: 2rem;
    color: var(--apple-secondary);
    font-weight: 700;
    font-family: 'Comic Neue', 'Inter', sans-serif;
    margin-bottom: 15px;
}

.detail-pos {
    display: inline-block;
    background: var(--apple-primary);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    color: white;
    font-weight: 600;
    margin-bottom: 20px;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section h3 {
    font-size: 1.3rem;
    color: var(--apple-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--apple-gray-3);
}

.detail-section p {
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.detail-section ul {
    list-style-type: none;
    padding-left: 0;
}

.detail-section li {
    padding: 8px 0;
    border-bottom: 1px solid var(--apple-gray-3);
}

.detail-section li:last-child {
    border-bottom: none;
}

.example-sentence {
    background: var(--apple-gray-4);
    padding: 15px;
    border-radius: 12px;
    margin-top: 10px;
    border-left: 4px solid var(--apple-primary);
}

.example-sentence p {
    margin-bottom: 5px;
}

.example-sentence .pinyin {
    color: var(--text-tertiary);
    font-style: italic;
}

.quiz-option {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 10px;
    background: var(--apple-gray-4);
    transition: var(--apple-transition-fast);
}

.quiz-option:hover {
    background: var(--apple-gray-3);
}

.quiz-option.correct {
    background: #d4edda;
    border-left: 4px solid var(--apple-success);
}

.quiz-option .emoji {
    margin-right: 10px;
    font-size: 1.2rem;
}

.detail-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--apple-gray-3);
    color: var(--text-tertiary);
    font-size: 14px;
}

/* ========== 底部下载区域 ========== */
.bottom-download {
    background: linear-gradient(135deg, var(--apple-primary) 0%, var(--apple-secondary) 100%);
    border-radius: 20px;
    padding: 40px 30px;
    margin-top: 40px;
    text-align: center;
    color: white;
    box-shadow: var(--apple-shadow-md);
}

.download-content h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-family: 'Comic Neue', 'Inter', sans-serif;
}

.download-content p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto 25px;
    line-height: 1.5;
}

/* ========== 页面底部 ========== */
.home-footer {
    background: linear-gradient(135deg, var(--text-primary) 0%, #4a5568 100%);
    color: white;
    padding: 70px 20px 30px;
    text-align: center;
    border-radius: 30px 30px 0 0;
    margin-top: 60px;
}

.home-footer-logo {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--apple-primary), var(--apple-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.home-footer-tagline {
    max-width: 600px;
    margin: 0 auto 40px;
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.9;
}

.home-footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.home-footer-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: var(--apple-transition-fast);
}

.home-footer-link:hover {
    color: var(--apple-primary);
    transform: translateY(-2px);
}

.home-copyright {
    margin-top: 50px;
    font-size: 14px;
    opacity: 0.7;
}

/* ========== 状态指示器 ========== */
.loading {
    text-align: center;
    padding: 80px 20px;
    color: var(--apple-primary);
    font-size: 1.4rem;
    grid-column: 1 / -1;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { color: rgba(0, 122, 255, 0); }
    40% { color: var(--apple-primary); }
    60% { color: var(--apple-primary); }
    80%, 100% { color: var(--apple-primary); }
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--apple-primary);
    background: var(--apple-card-bg);
    border-radius: 20px;
    box-shadow: var(--apple-shadow-sm);
    border: 1px solid var(--apple-gray-3);
}

.empty-state p {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.error {
    background: #fed7d7;
    color: var(--apple-danger);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin: 20px 0;
    grid-column: 1 / -1;
    border: 2px solid #feb2b2;
}

/* ========== 收藏按钮系统 ========== */
.favorite-btn, .favorite-btn-back, .favorite-btn-detail {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--apple-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid var(--apple-gray-3);
}

.favorite-btn::before, .favorite-btn-back::before, .favorite-btn-detail::before {
    content: "⭐";
    font-size: 20px;
    line-height: 1;
    transition: var(--apple-transition-fast);
}

.favorite-btn:hover, .favorite-btn-back:hover, .favorite-btn-detail:hover {
    background: rgba(0, 122, 255, 0.1);
    transform: scale(1.1);
    border-color: var(--apple-primary);
}

.favorite-btn.favorited::before, .favorite-btn-back.favorited::before, .favorite-btn-detail.favorited::before {
    content: "❤️";
    color: var(--apple-danger);
}

.favorite-btn.favorited, .favorite-btn-back.favorited, .favorite-btn-detail.favorited {
    background: rgba(255, 59, 48, 0.1);
    border-color: var(--apple-danger);
}

/* 闪卡正面收藏按钮 */
.flashcard-front .favorite-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
}

/* 闪卡背面收藏按钮 */
.flashcard-back .favorite-btn-back {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
}

/* 详情页面收藏按钮 */
.favorite-btn-detail {
    position: absolute;
    top: 20px;
    right: 80px;
}

/* ========== 朗读按钮系统 ========== */
.speak-btn-inline, .speak-btn-back-inline, .speak-btn-detail-inline {
    background: none;
    border: none;
    color: var(--apple-primary);
    cursor: pointer;
    transition: var(--apple-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    border: 1px solid var(--apple-gray-3);
}

.speak-btn-inline:hover, .speak-btn-back-inline:hover, .speak-btn-detail-inline:hover {
    background: rgba(0, 122, 255, 0.1);
    transform: scale(1.1);
    border-color: var(--apple-primary);
}

.speak-btn-inline.playing, .speak-btn-back-inline.playing, .speak-btn-detail-inline.playing {
    color: var(--apple-danger);
    background: rgba(255, 59, 48, 0.1);
    border-color: var(--apple-danger);
    animation: pulse 1s infinite;
}

/* ========== 内联容器 ========== */
.word-with-speak, .translation-with-speak, .detail-word-with-speak {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.detail-word-with-speak {
    justify-content: flex-start;
}

.card-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    align-items: center;
    justify-content: center;
}

/* ========== 高亮搜索 ========== */
.flashcard.highlighted {
    border-color: var(--apple-primary);
    box-shadow: 0 0 0 2px var(--apple-primary-light);
}

.highlight {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1200px) {
    .flashcards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .detail-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .flashcards-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .panda-title h1 {
        font-size: 2.5rem;
    }
    
    .panda-emoji {
        font-size: 3.5rem;
    }
    
    .daily-word-main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .header {
        padding: 40px 20px;
    }
    
    .panda-title h1 {
        font-size: 2.2rem;
    }
    
    .header p {
        font-size: 1.1rem;
    }
    
    .download-btn {
        position: relative;
        top: auto;
        right: auto;
        display: inline-block;
        margin-top: 15px;
    }
    
    .controls {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    .filter-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-item {
        min-width: 100%;
    }
    
    .flashcard-detail {
        margin: 20px auto;
        padding: 20px;
    }
    
    .detail-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .detail-emoji {
        margin: 0 auto 15px;
    }
    
    .detail-word-line {
        justify-content: center;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .action-center {
        order: 1;
    }
    
    .prev-btn, .next-btn {
        order: 2;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .flashcards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .panda-title {
        flex-direction: column;
        gap: 10px;
    }
    
    .panda-title h1 {
        font-size: 2rem;
    }
    
    .header {
        border-radius: 16px;
    }
    
    .daily-word-container {
        padding: 20px;
    }
    
    .detail-word {
        font-size: 2rem;
    }
    
    .detail-translation {
        font-size: 1.8rem;
    }
    
    .word-left-section {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .action-links {
        flex-direction: column;
        gap: 15px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--apple-gray-3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--apple-primary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0066cc;
}

/* 工具类 */
.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* 禁用状态 */
.btn:disabled, .favorite-btn[disabled], .speak-btn-inline[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}