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

:root {
    --primary: #FF9F43;
    --success: #1DD1A1;
    --purple: #A55EEA;
    --pink: #FF6B81;
    --yellow: #FECA57;
    --blue: #54A0FF;
    --bg: #F8F9FA;
    --card-bg: #FFFFFF;
    --text: #2C3E50;
    --text-light: #7F8C8D;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #FFF5EB 0%, #F0F7FF 100%);
    min-height: 100vh;
    color: var(--text);
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
}

.app-header {
    background-image: linear-gradient(-20deg, #00cdac 0%, #8ddad5 100%);
    background-size: 400% 400%;
    animation: gradientShift 10s ease infinite;
    padding: 16px 20px 20px;
    color: white;
    box-shadow: 0 8px 24px rgba(255, 107, 129, 0.25);
    position: relative;
    overflow: hidden;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-weight: 800;
    font-size: 35px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.app-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.app-nav a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.app-nav a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.app-main {
    flex: 1;
    padding: 20px;
}

.page-content {
    animation: fadeIn 0.3s ease;
}

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    color: var(--text);
}

.btn {
    padding: 12px 28px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--pink) 100%);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: #E8E8E8;
    color: var(--text);
}

.btn-secondary:hover {
    background: #D8D8D8;
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #00D199 100%);
    color: white;
}

.btn-success:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.word-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid transparent;
}

.word-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.word-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.word-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.word-btn {
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.word-btn-play {
    background: linear-gradient(135deg, var(--success) 0%, #00D199 100%);
    color: white;
}

.word-btn-edit {
    background: linear-gradient(135deg, var(--blue) 0%, #54A0FF 100%);
    color: white;
}

.word-btn-delete {
    background: #FF6B6B;
    color: white;
}

.word-btn-video {
    background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
    color: white;
}

.word-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.word-content {
    display: none;
}

.word-content.active {
    display: block;
}

.word-item {
    padding: 14px 0;
    border-bottom: 1px solid #F0F0F0;
}

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

.word-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.word-translation {
    font-size: 16px;
    color: var(--text-light);
}

.toggle-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn:hover {
    background: #FF8C29;
}

.form-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.form-card h2 {
    margin-bottom: 20px;
    font-size: 24px;
    color: var(--text);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E8E8E8;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.speed-control {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.speed-control label {
    font-weight: 500;
}

.speed-control input[type="range"] {
    flex: 1;
    max-width: 300px;
}

.speed-value {
    font-weight: 600;
    color: var(--primary);
}

.video-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
}

.video-preview {
    position: relative;
    width: 150px;
}

.video-preview video,
.video-preview img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
}

.video-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #FF6B6B;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 20px;
}

#video-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.2s ease;
}

.video-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 900px;
    border-radius: 16px;
    position: relative;
}

.video-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.video-modal-close:hover {
    color: black;
}

.video-modal-title {
    margin-bottom: 16px;
    color: var(--text);
}

.video-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.video-thumbnail {
    padding: 12px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.video-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.video-player-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
}

.video-player-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 18px;
}

.videos-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
}

.video-item {
    position: relative;
    width: 150px;
}

.video-item video {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
}

.video-label {
    text-align: center;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-light);
}

.progress-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    height: 20px;
    background: #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--pink) 100%);
    border-radius: 10px;
    transition: none;
}

.section-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.celebration {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: celebratePopIn 0.5s ease-out;
}

@keyframes celebratePopIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    70% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.celebration-icon {
    font-size: 5rem;
    display: block;
    margin-bottom: 1rem;
    animation: bounce 1s infinite;
}

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

@media (max-width: 600px) {
    .app-header {
        padding: 12px 16px 16px;
    }
    
    .logo-text {
        font-size: 28px;
    }
    
    .app-main {
        padding: 16px;
    }
    
    .form-card {
        padding: 16px;
    }
    
    .word-card {
        padding: 16px;
    }
    
    .word-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .speed-control {
        flex-direction: column;
        align-items: stretch;
    }
    
    .speed-control input[type="range"] {
        max-width: 100%;
    }
}
