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

body {
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Mobile-first Navigation */
.main-nav {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.main-nav.hide-on-scroll {
    transform: translateY(-100%);
}

.nav-container {
    max-width: 100%;
    padding: 0 15px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 60px;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    gap: 4px;
    z-index: 1001;
}

.hamburger {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-menu.active {
    opacity: 1;
    visibility: visible;
}

.nav-item {
    display: block;
    padding: 25px 40px;
    color: white;
    text-decoration: none;
    font-size: 24px;
    font-weight: 500;
    border-bottom: none;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 200px;
    margin: 10px 0;
    border-radius: 15px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    border-left: none;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.container {
    max-width: 100vw;
    margin: 0 auto;
    padding: 15px;
    padding-top: 75px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    margin-bottom: 20px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

header h1 {
    color: white;
    font-size: 2rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-btn:active {
    transform: scale(0.98);
}

.filter-btn.active {
    background: white;
    color: #667eea;
}

.progress {
    color: white;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 1px;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.word-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 25px 15px;
    margin-bottom: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-progress {
    font-size: 36px;
    font-weight: bold;
    color: #667eea;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.word-section {
    width: 100%;
}

.word-item {
    margin-bottom: 20px;
    text-align: center;
}

.word-item:last-child {
    margin-bottom: 0;
}

.label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.content {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    padding: 18px 15px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    user-select: none;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content.covered {
    background: #f0f0f0;
    color: #999;
    font-size: 18px;
    border: 3px dashed #ccc;
}

.content:not(.covered) {
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.content:active {
    transform: scale(0.98);
}

.audio-item .content {
    display: none;
}

.audio-btn {
    font-size: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 18px;
    border-radius: 50%;
    transition: all 0.3s ease;
    min-width: 70px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-btn.covered {
    background: #f0f0f0;
    border: 3px dashed #ccc;
    color: #999;
}

.audio-btn:not(.covered) {
    background: linear-gradient(45deg, #ff6b6b 0%, #ffd93d 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255,107,107,0.3);
}

.audio-btn:active {
    transform: scale(0.95);
}

.navigation {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.nav-btn {
    flex: 1;
    background: white;
    color: #667eea;
    border: none;
    padding: 15px 20px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-height: 50px;
}

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

.nav-btn:not(:disabled):active {
    transform: translateY(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.self-assess-controls {
    margin-top: 20px;
    margin-bottom: 15px;
}

.assess-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.assess-btn {
    flex: 1;
    border: none;
    padding: 16px 20px;
    border-radius: 15px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 56px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.know-btn {
    background: linear-gradient(45deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.dont-know-btn {
    background: linear-gradient(45deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.assess-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.review-btn {
    background: rgba(255,193,7,0.9);
    color: #333;
    border: 2px solid #ffc107;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    white-space: nowrap;
    flex-shrink: 0;
}

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

.review-btn.active {
    background: #ffc107;
    color: white;
}

@media (min-width: 768px) {
    .nav-container {
        max-width: 750px;
        margin: 0 auto;
        padding: 0 25px;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .container {
        max-width: 750px;
        padding: 30px 25px;
        padding-top: 90px;
    }
    
    header {
        margin-bottom: 25px;
    }
    
    .header-row {
        margin-bottom: 0;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .controls {
        gap: 20px;
    }
    
    .filter-btn {
        padding: 14px 25px;
        font-size: 17px;
        min-height: 52px;
    }
    
    .progress {
        font-size: 32px;
    }
    
    .navigation {
        gap: 20px;
        margin-bottom: 25px;
    }
    
    .nav-btn {
        padding: 18px 30px;
        font-size: 18px;
        border-radius: 18px;
        min-height: 60px;
        box-shadow: 0 5px 18px rgba(0,0,0,0.12);
    }
    
    .word-card {
        padding: 35px 25px;
        margin-bottom: 25px;
        border-radius: 25px;
        box-shadow: 0 12px 35px rgba(0,0,0,0.15);
    }

    .card-progress {
        font-size: 48px;
        margin-bottom: 30px;
    }
    
    .word-section {
        display: grid;
        grid-template-columns: 1fr;
        gap: 25px;
        max-width: 550px;
        margin: 0 auto;
    }
    
    .word-item {
        margin-bottom: 0;
    }
    
    .audio-item {
        text-align: center;
        margin-bottom: 15px;
    }
    
    .audio-btn {
        font-size: 40px;
        min-width: 100px;
        min-height: 100px;
        border-radius: 50px;
        box-shadow: 0 6px 20px rgba(0,0,0,0.12);
        padding: 20px;
    }
    
    .audio-btn.covered {
        border: 3px dashed #ccc;
    }
    
    .audio-btn:not(.covered) {
        box-shadow: 0 6px 25px rgba(255,107,107,0.35);
    }
    
    .content {
        font-size: 36px;
        padding: 25px 20px;
        border-radius: 18px;
        min-height: 85px;
        font-weight: 600;
    }
    
    .content.covered {
        font-size: 20px;
        border: 3px dashed #ccc;
    }
    
    .self-assess-controls {
        margin-top: 25px;
    }

    .assess-buttons {
        gap: 20px;
    }

    .assess-btn {
        padding: 18px 30px;
        font-size: 20px;
        border-radius: 18px;
        min-height: 64px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 900px;
        padding: 60px 50px;
    }
    
    .word-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 40px;
        align-items: center;
        max-width: 700px;
        margin: 0 auto;
    }
    
    .audio-item {
        grid-column: 1;
        grid-row: 1;
        margin-bottom: 0;
    }
    
    #simplified {
        grid-column: 2;
        grid-row: 1;
    }
    
    #traditional {
        grid-column: 1;
        grid-row: 2;
    }
    
    #pinyin {
        grid-column: 2;
        grid-row: 2;
    }
    
    .content {
        font-size: 48px;
        padding: 35px;
    }
}

@media (min-width: 1024px) and (orientation: landscape) {
    .word-section {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 35px;
        max-width: 800px;
        height: auto;
    }
    
    .audio-item {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .word-item {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Vocabulary page styles */
.vocabulary-main {
    flex: 1;
}

.vocab-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.vocab-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    transition: transform 0.2s ease;
}

.vocab-card:active {
    transform: scale(0.98);
}

.vocab-card.important {
    border-left: 4px solid #ff6b6b;
}

.vocab-simplified {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.vocab-traditional {
    font-size: 20px;
    color: #666;
    margin-bottom: 8px;
}

.vocab-pinyin {
    font-size: 16px;
    color: #999;
    margin-bottom: 12px;
    font-style: italic;
}

.vocab-audio {
    background: linear-gradient(45deg, #ff6b6b 0%, #ffd93d 100%);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255,107,107,0.3);
    transition: transform 0.2s ease;
}

.vocab-audio:active {
    transform: scale(0.95);
}

.important-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff6b6b;
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

/* Progress page styles */
.progress-main {
    flex: 1;
}

.progress-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.progress-chart {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    margin-bottom: 20px;
}

.progress-ring {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    position: relative;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
}

.progress-ring circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

.progress-bg {
    stroke: #f0f0f0;
}

.progress-fill {
    stroke: #667eea;
    stroke-dasharray: 314;
    stroke-dashoffset: 157;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.week-progress {
    display: flex;
    justify-content: space-around;
    align-items: end;
    height: 120px;
    gap: 10px;
}

.day-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.day-name {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.day-bar {
    width: 20px;
    height: 80px;
    background: #f0f0f0;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.day-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: height 0.8s ease;
}

.day-count {
    font-size: 12px;
    color: #333;
    margin-top: 8px;
    font-weight: bold;
}

/* Settings page styles */
.settings-main {
    flex: 1;
}

.settings-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.settings-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.setting-label {
    font-size: 16px;
    color: #333;
}

.setting-toggle {
    width: 50px;
    height: 28px;
    background: #ccc;
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.setting-toggle.active {
    background: #667eea;
}

.setting-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.setting-toggle.active::after {
    transform: translateX(22px);
}

.setting-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.setting-btn:active {
    transform: translateY(0);
}

.setting-btn.danger {
    background: #e53e3e;
}

.setting-btn.danger:hover {
    background: #c53030;
}

.about-info {
    color: #666;
    line-height: 1.6;
}

.about-info p {
    margin-bottom: 8px;
}

.about-info strong {
    color: #333;
}

@media (min-width: 768px) {
    .vocab-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .progress-stats {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .vocab-card {
        padding: 25px;
    }
    
    .vocab-simplified {
        font-size: 26px;
    }
    
    .vocab-traditional {
        font-size: 22px;
    }
    
    .vocab-pinyin {
        font-size: 18px;
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    .container {
        padding: 15px;
    }
    
    header {
        margin-bottom: 20px;
    }
    
    .word-card {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .word-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 20px;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .audio-item {
        grid-column: 1;
        grid-row: 1;
        margin-bottom: 0;
    }
    
    #simplified {
        grid-column: 2;
        grid-row: 1;
    }
    
    #traditional {
        grid-column: 1;
        grid-row: 2;
    }
    
    #pinyin {
        grid-column: 2;
        grid-row: 2;
    }
    
    .word-item {
        margin-bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .content {
        padding: 12px;
        font-size: 20px;
        min-height: 50px;
    }
    
    .audio-btn {
        font-size: 24px;
        min-width: 60px;
        min-height: 60px;
        padding: 15px;
    }
}