* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    padding: 20px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}
.container { max-width: 500px; margin: 0 auto; }

/* 顶部选项 */
.top-options {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}
.option-btn {
    flex: 1;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 40px;
    padding: 12px 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.nav-item.active { 
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    } 
.option-btn:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.3);
}

/* 模式提示 */
.mode-bar {
    background: #ff9800;
    border-radius: 30px;
    padding: 8px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}
.exit-mode { cursor: pointer; }
.wrong-badge {
    background: #f44336;
    padding: 4px 12px;
    border-radius: 30px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

/* 汉字区域 */
.character-wrapper {
    position: relative;
    text-align: center;
    margin: 30px 0;
}
.character-circle {
    background: white;
    width: 200px;
    height: 200px;
    line-height: 200px;
    text-align: center;
    border-radius: 50%;
    margin: 0 auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    font-size: 80px;
    font-weight: bold;
    color: #333;
    transition: background-color 0.3s;
}
.point-toast {
    position: absolute;
    top: -10px;
    right: 20%;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    animation: fadeOutPoint 1s ease forwards;
    pointer-events: none;
    z-index: 100;
}
.point-toast.positive { background: #4caf50; }
.point-toast.negative { background: #f44336; }
@keyframes fadeOutPoint {
    0% { opacity: 1; transform: scale(1); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.2); }
}

/* 读音选项 */
.options-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
}
.pinyin-btn {
    background: white;
    padding: 18px 15px;
    text-align: center;
    border-radius: 10px;
    font-size: 22px;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: none;
    width: 100%;
}
.pinyin-btn:hover { transform: translateY(-2px); }
.pinyin-btn.correct {
    background: #2e7d32 !important;
    color: white !important;
    transform: scale(1.05) !important;
}

.pinyin-btn.wrong {
    background: #d50000 !important;
    color: white !important;
    transform: scale(0.97) !important;
}

/* 组词区域 */
.words-section {
    background: rgba(255,255,255,0.9);
    border-radius: 20px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}
.word-item {
    background: #e8f0fe;
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 18px;
    font-weight: 500;
    color: #4a5568;
}

/* 汉字来源 */
.char-source {
    background: rgba(255,255,255,0.9);
    border-radius: 20px;
    padding: 10px 15px;
    margin: 15px 0;
    text-align: center;
    font-size: 12px;
    color: #667eea;
}

/* 宠物区域 */
.pet-section {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}
.pet-emoji { font-size: 70px; transition: transform 0.2s; }
.pet-name { font-size: 18px; font-weight: bold; margin: 8px 0; }
.pet-growth-bar { background: #e9ecef; border-radius: 20px; height: 10px; margin: 10px 0; overflow: hidden; }
.pet-growth-fill { background: linear-gradient(90deg, #10b981, #059669); width: 0%; height: 100%; transition: width 0.3s; }


/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    padding: 20px;
}
.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    background: none;
    border: none;
}
.tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-right: 30px;
}
.tab {
    padding: 12px 0;
    font-size: 16px;
    font-weight: 500;
    color: #999;
    cursor: pointer;
    flex: 1;
    text-align: center;
}
.tab.active {
    color: #667eea;
    border-bottom: 2px solid #667eea;
    margin-bottom: -2px;
}
.tab-content { display: none; }
.tab-content.active { display: block; }
.exchange-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}
.exchange-card {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}
.exchange-card:hover {
    border-color: #667eea;
    transform: scale(1.02);
}
.exchange-emoji { font-size: 40px; }
.exchange-name { font-weight: bold; margin: 8px 0 4px; }
.exchange-cost { font-size: 12px; color: #ff9800; }
.exchange-growth { font-size: 11px; color: #4caf50; }
.pet-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.pet-option {
    text-align: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
}
.pet-option:hover { background: #667eea; color: white; }
.pet-option.selected { background: #667eea; color: white; border-color: #667eea; }
.pet-option.disabled { opacity: 0.5; cursor: not-allowed; }
.close-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #e9ecef;
    border: none;
    border-radius: 30px;
    margin-top: 15px;
    cursor: pointer;
}
/* 错字卡片弹窗样式 */
.card-modal-content {
    background: white;
    border-radius: 32px;
    width: 90%;
    max-width: 380px;
    overflow: hidden;
    animation: modalIn 0.3s ease;
}
.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}
.card-title {
    font-size: 18px;
    font-weight: 600;
}
.card-nav {
    font-size: 20px;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 30px;
    transition: background 0.2s;
}
.card-nav:hover {
    background: rgba(255,255,255,0.2);
}
.card-body {
    padding: 30px 24px;
    text-align: center;
}
.card-hanzi {
    font-size: 80px;
    font-weight: bold;
    color: #333;
    background: #f0f2f5;
    width: 150px;
    height: 150px;
    line-height: 150px;
    text-align: center;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.card-pinyin {
    font-size: 28px;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 10px;
}
.card-type {
    display: inline-block;
    background: #e8f5e9;
    color: #4caf50;
    padding: 4px 16px;
    border-radius: 30px;
    font-size: 14px;
    margin-bottom: 15px;
}
.card-words {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}
.card-word {
    background: #f0f2f5;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 16px;
    color: #555;
}
.card-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}
.card-btn {
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}
.card-btn.correct {
    background: #4caf50;
    color: white;
}
.card-btn:not(.correct) {
    background: #e9ecef;
    color: #666;
}
.card-btn:hover {
    transform: translateY(-2px);
}
.card-counter {
    font-size: 12px;
    color: #999;
    margin-top: 15px;
}
.wrong-char-tag {
    background: #f0f2f5;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.wrong-char-tag:hover {
    background: #667eea;
    color: white;
    transform: scale(1.02);
}
@media (max-width: 600px) {
    .character-circle { width: 160px; height: 160px; line-height: 160px; font-size: 60px; }
    .pinyin-btn { padding: 14px; font-size: 18px; }
    .word-item { padding: 8px 16px; font-size: 16px; }
    .option-btn { font-size: 13px; padding: 10px 0; }
}