/* Modern Redesigned styles.css */
@import url('fonts/poppins.css');

@font-face {
    font-family: 'DictBats';
    src: url('DICTBATS.TTF') format('truetype');
}

:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #f472b6;
    --accent-color: #8b5cf6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f6f7ff 0%, #e9f0ff 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    margin-top:-8rem;
    padding: 2rem;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    width: 90%;  /* 确保在小屏幕上也能占用足够宽度 */
}

.title-container {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
}

.title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.subtitle {
    color: var(--text-light);
    font-weight: 400;
    font-size: 1rem;
}

.chapter-title {
    color: var(--accent-color);
    font-weight: 500;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: rgba(139, 92, 246, 0.1);
    border-radius: var(--radius-md);
    display: inline-block;
}

/* Settings Panel */
.settings {
    animation: fadeIn 0.5s ease;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-range {
    width: 100%;
    height: 0.5rem;
    border-radius: var(--radius-sm);
    background-color: #e2e8f0;
    appearance: none;
}

.form-range::-webkit-slider-thumb {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: var(--transition-fast);
}

.form-range::-webkit-slider-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    background-color: var(--bg-white);
    transition: var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 滑动开关样式 */
.switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.switch-label {
    font-weight: 500;
    color: var(--text-dark);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: var(--transition-normal);
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-normal);
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
}

input:focus + .slider {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn:focus {
    outline: none;
}

.btn-primary {
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(to right, var(--primary-dark), var(--primary-dark));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: linear-gradient(to right, var(--error-color), #dc2626);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(to right, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: #d1d5db;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    padding: 0;
}

/* Quiz Section */
.quiz-container {
    animation: fadeIn 0.5s ease;
}

.progress-container {
    margin-bottom: 1.5rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.progress-bar-outer {
    height: 0.5rem;
    background-color: #e2e8f0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-sm);
    transition: width 0.3s ease;
}

.timer-progress {
    height: 4px;
    background: #e2e8f0;
    margin: 1.5rem 0;
    border-radius: 2px;
    overflow: hidden;
}

.timer-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, var(--primary-light), var(--accent-color));
    transition: width 1s linear;
}

.input-container {
    position: relative;
    margin: 2rem 0;
}

#userInput {
    width: 100%;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    padding: 1rem;
    border: none;
    border-bottom: 2px solid #e2e8f0;
    background: transparent;
    transition: var(--transition-normal);
}

/* 保持中文提示的字体不变 */
#userInput::placeholder {
    font-size: 1.5rem;
    font-weight: 400;
}

#userInput:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
}

.input-focus-effect {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    transition: var(--transition-normal);
    transform: translateX(-50%);
}

#userInput:focus ~ .input-focus-effect {
    width: 100%;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* Countdown Animation */
.countdown-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    z-index: 10;
    border-radius: var(--radius-lg);
}

/* Side Panels */
.side-panel {
    position: fixed;
    top: 0;
    height: 100vh;
    width: 400px;
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    overflow-y: auto;
    z-index: 1050;
    transition: var(--transition-normal);
}

#answeredWordsPanel {
    right: -420px;
}

#answeredWordsPanel.show {
    right: 0;
}

#errorWordsPanel {
    left: -420px;
}

#errorWordsPanel.show {
    left: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-close:hover {
    color: var(--text-dark);
}

.panel-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

/* Word Items */
.word-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.word-item {
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
}

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

.word-item.correct {
    background-color: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success-color);
}

.word-item.incorrect {
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--error-color);
}

.word-text {
    font-weight: 500;
}

.word-answer {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.word-actions {
    display: flex;
    gap: 0.5rem;
}

.play-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.play-btn:hover {
    color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.1);
}

.remove-btn {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.remove-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Floating Buttons */
.floating-buttons {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1040;
}

.floating-btn {
    width: auto;
    min-width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: var(--transition-normal);
    padding: 0 1.25rem;
    color: white;
    overflow: hidden;
}

.floating-btn i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.floating-btn span {
    white-space: nowrap;
    transform: translateX(10px);
    transition: var(--transition-normal);
}

.floating-btn:hover span {
    opacity: 1;
    transform: translateX(0);
}

.floating-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.answered-btn {
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
}

.error-btn {
    background: linear-gradient(to right, var(--error-color), #dc2626);
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .side-panel {
        width: 100%;
    }
    
    #answeredWordsPanel {
        right: -100%;
    }
    
    #errorWordsPanel {
        left: -100%;
    }
    
    .floating-buttons {
        bottom: 1rem;
        right: 1rem;
    }
    
    .floating-btn {
        width: 3rem;
        height: 3rem;
        padding: 0;
    }
    
    .floating-btn i {
        margin-right: 0;
    }
    
    .floating-btn span {
        display: none;
    }
}

/* Modal */
.modal {

display: none;

position: fixed;

top: 0;

left: 0;

width: 100%;

height: 100%;

background-color: rgba(0,0,0,0.5);

z-index: 1000;

justify-content: center;

align-items: center;

opacity: 0;

transition: opacity 0.3s ease;

}

.modal.show {

display: flex;

opacity: 1;

}

.modal-content {

background-color: white;

border-radius: 10px;

width: 90%;

max-width: 600px;

box-shadow: 0 5px 15px rgba(0,0,0,0.3);

transform: translateY(-20px);

transition: transform 0.3s ease;

}

.modal.show .modal-content {

transform: translateY(0);

}

.modal-header {

padding: 20px;

border-bottom: 1px solid #eee;

display: flex;

justify-content: space-between;

align-items: center;

}

.modal-title {

margin: 0;

font-size: 1.5rem;

color: #333;

}

.modal-close {

background: none;

border: none;

font-size: 1.5rem;

cursor: pointer;

color: #999;

}

.modal-body {

padding: 20px;

}

.stats-grid {

display: grid;

grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));

gap: 20px;

margin-bottom: 20px;

}

.stat-card {

background: #f9f9f9;

border-radius: 8px;

padding: 15px;

text-align: center;

transition: transform 0.3s ease;

}

.stat-card:hover {

transform: translateY(-5px);

box-shadow: 0 5px 10px rgba(0,0,0,0.1);

}

.stat-icon {

font-size: 2rem;

color: #4a6bdf;

margin-bottom: 10px;

}

.stat-label {

font-size: 0.9rem;

color: #666;

margin-bottom: 5px;

}

.stat-value {

font-size: 1.5rem;

font-weight: bold;

color: #333;

}

.stat-unit {

font-size: 0.8rem;

color: #888;

}

.modal-actions {

display: flex;

justify-content: flex-end;

padding-top: 20px;

border-top: 1px solid #eee;

}

.btn {

padding: 10px 20px;

border-radius: 5px;

cursor: pointer;

font-weight: bold;

transition: all 0.3s ease;

}

.btn-primary {

background-color: #4a6bdf;

color: white;

border: none;

}

.btn-primary:hover {

background-color: #3a5bcf;

}

@media (max-width: 768px) {

.stats-grid {

grid-template-columns: repeat(2, 1fr);

}

}

@media (max-width: 480px) {

.stats-grid {

grid-template-columns: 1fr;

}


.modal-content {

width: 95%;

}

}

button i { margin-right:4px;}
