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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 24px;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #e74c3c;
    margin-bottom: 12px;
}

nav {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.nav-btn {
    padding: 8px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn.active {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.hint {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
}

textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: #e74c3c;
}

.primary-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: opacity 0.2s;
}

.primary-btn:hover {
    opacity: 0.9;
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.secondary-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: white;
    color: #666;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 8px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.card.highlight {
    border-left: 4px solid #e74c3c;
}

.label {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.chinese-text {
    font-size: 16px;
    color: #333;
}

.spanish-text {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    line-height: 1.4;
}

.icon-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    background: #fef0ef;
    color: #e74c3c;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.pin-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: white;
    color: #999;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s;
}

.pin-btn.pinned {
    background: #fff8e1;
    color: #f59e0b;
    border-color: #f59e0b;
}

.review-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-btn {
    flex: 1;
    padding: 8px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: #1d1d1f;
    color: white;
    border-color: #1d1d1f;
}

.review-pin-icon {
    color: #f59e0b;
    margin-right: 4px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-phrase-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.breakdown-phrase {
    font-weight: 600;
    color: #e74c3c;
}

.breakdown-listen {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.breakdown-listen:hover {
    opacity: 1;
}

.breakdown-meaning {
    color: #666;
    text-align: right;
}

.breakdown-note {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

/* Record button */
.record-area {
    text-align: center;
    margin: 24px 0;
}

.record-btn {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 4px solid #e74c3c;
    background: white;
    color: #e74c3c;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.record-btn.recording {
    background: #e74c3c;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.status {
    margin-top: 8px;
    font-size: 14px;
    color: #999;
}

.transcription {
    font-style: italic;
    color: #333;
    font-size: 15px;
}

.score {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
}

.score[data-score="5"] { color: #27ae60; }
.score[data-score="4"] { color: #2ecc71; }
.score[data-score="3"] { color: #f39c12; }
.score[data-score="2"] { color: #e67e22; }
.score[data-score="1"] { color: #e74c3c; }

/* Review */
.review-item {
    background: white;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.1s;
}

.review-item:active {
    transform: scale(0.98);
}

.review-chinese {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.review-spanish {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
}

.review-date {
    font-size: 12px;
    color: #bbb;
    margin-top: 4px;
}

/* Loading */
.loading {
    position: fixed;
    inset: 0;
    background: rgba(245,245,247,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #e74c3c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-text {
    font-size: 14px;
    color: #666;
}
