/* ============================================
   登录界面样式
   ============================================ */

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.login-overlay.hidden {
    display: none;
}

.login-container {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 24px;
    padding: 50px 40px;
    width: 420px;
    max-width: 90vw;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px) saturate(160%);
    animation: fadeIn 0.4s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-header iconify-icon {
    color: #8d6e63;
    margin-bottom: 10px;
}

.login-header h1 {
    font-size: 1.8rem;
    color: #4e342e;
    margin-bottom: 6px;
}

.login-header p {
    color: #795548;
    font-size: 0.95rem;
}

.login-field {
    margin-bottom: 22px;
}

.login-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #5d4037;
    font-size: 0.95rem;
}

.login-field input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(141, 110, 99, 0.3);
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
    transition: all 0.3s;
    color: #333;
}

.login-field input:focus {
    outline: none;
    border-color: #8d6e63;
    box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.15);
    background: rgba(255, 255, 255, 0.5);
}

.login-error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.4);
    border-radius: 8px;
    padding: 10px 14px;
    color: #c62828;
    font-size: 0.9rem;
    margin-bottom: 16px;
    backdrop-filter: blur(5px);
}

.login-error.hidden {
    display: none;
}

.login-btn {
    margin-top: 8px;
    padding: 16px;
    font-size: 1.1rem;
}

/* 用户信息栏 */
.user-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #5d4037;
    font-weight: 500;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(93, 64, 55, 0.3);
    border-radius: 8px;
    color: #5d4037;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.5);
    border-color: #5d4037;
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

:root {
    --opacity-overlay: 0.3;  /* body遮罩层透明度 */
    --opacity-container: 0.25;  /* 主容器透明度 */
    --opacity-panel: 0.3;  /* 面板透明度 */
    --opacity-text-bg: 0.25;  /* 文本框背景透明度 */
    --opacity-calendar: 0.95;  /* 日历容器透明度 */
    --opacity-table-bg: 0.1;  /* 表格背景透明度 */
    --opacity-table-header: 0.15;  /* 表头背景透明度 */
    --opacity-controls: 0.15;  /* 控制元素透明度 */
    --opacity-stat-card: 0.15;  /* 统计卡片透明度 */
    --blur-container: 20px;  /* 主容器模糊强度 */
    --saturate-container: 180%;  /* 主容器饱和度 */
    --blur-panel: 15px;  /* 面板模糊强度 */
    --saturate-panel: 160%;  /* 面板饱和度 */
}

/* 动画定义 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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

body {
    background-color: transparent;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 10px;
    position: relative;
    overflow-x: hidden;
}

/* 视频背景样式 */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -100;
    object-fit: cover;
    opacity: 0.85;
    filter: brightness(0.95) contrast(1.05);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, var(--opacity-overlay));
    z-index: -99;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, var(--opacity-container));
    border-radius: 24px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(var(--blur-container)) saturate(var(--saturate-container));
    transition: all 0.4s ease-in-out;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #a1887f 0%, #d7ccc8 100%);
    color: #4e342e;
    padding: 25px 30px;
    text-align: center;
    border-bottom: 3px dashed #8d6e63;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M0,50 Q25,40 50,50 T100,50" fill="none" stroke="rgba(255,255,255,0.3)" stroke-width="2"/></svg>');
    opacity: 0.3;
    z-index: 0;
}

.header h1 {
    font-size: 2.4rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.1);
}

.header h1 iconify-icon {
    color: #5d4037;
    transition: transform 0.3s ease-in-out;
}

.header h1:hover iconify-icon {
    transform: rotate(15deg) scale(1.1);
}

.header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 主内容区域 */
.main-content {
    display: flex;
    min-height: 700px;
    padding: 20px;
    gap: 20px;
}

/* 侧边栏样式 */
.sidebar {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel {
    background: rgba(255, 255, 255, var(--opacity-panel));
    border-radius: 18px;
    padding: 28px;
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.06),
        0 6px 12px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(var(--blur-panel)) saturate(var(--saturate-panel));
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #a1887f, #d7ccc8);
    opacity: 0.6;
}

.panel::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: #d7ccc8;
    border-radius: 0 0 10px 10px;
    opacity: 0.5;
    filter: blur(1px);
}

.panel:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.35);
    box-shadow:
        0 16px 35px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    border-color: rgba(161, 136, 127, 0.8);
    backdrop-filter: blur(var(--blur-container)) saturate(var(--saturate-container));
}

/* 练习日期控制容器 */
.practice-date-controls {
    overflow: visible !important;
}

.panel h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #5d4037;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px dotted #d7ccc8;
    position: relative;
}

.panel h2 iconify-icon {
    color: #8d6e63;
    transition: transform 0.3s ease-in-out;
}

.panel h2:hover iconify-icon {
    transform: scale(1.1);
}

/* 表单组 */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    display: flex;
    align-items: center;
    gap: 8px;
}

textarea, select {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, var(--opacity-text-bg));
    border: 1px solid rgba(221, 221, 221, 0.6);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    resize: vertical;
    backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    color: #333;
}

textarea:focus, select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.35);
    border-color: #8d6e63;
    box-shadow:
        0 0 0 3px rgba(141, 110, 99, 0.15),
        inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

textarea {
    min-height: 150px;
    font-family: monospace;
    line-height: 1.5;
}

.help-text {
    font-size: 0.85rem;
    color: #777;
    margin-top: 6px;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.radio {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(224, 224, 224, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.radio:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(141, 110, 99, 0.4);
    backdrop-filter: blur(8px);
}

.radio input {
    margin-right: 12px;
    transform: scale(1.2);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    margin-bottom: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, #8d6e63 0%, #a1887f 100%);
    color: white;
    border: 1px solid #6d4c41;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(141, 110, 99, 0.25);
    background: linear-gradient(135deg, #7b5e57 0%, #8d6e63 100%);
}

.btn-secondary {
    background: #efebe9;
    color: #5d4037;
    border: 1px solid #d7ccc8;
}

.btn-secondary:hover {
    background: #d7ccc8;
    color: #4e342e;
}

.btn-warning {
    background: #ff9800;
    color: white;
    border: 1px solid #ef6c00;
}

.btn-warning:hover {
    background: #ef6c00;
}

.btn-success {
    background: #4CAF50;
    color: white;
    border: 1px solid #388e3c;
}

.btn-success:hover {
    background: #388e3c;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.9rem;
    width: auto;
}

.btn-hint {
    background: #795548;
    color: white;
    border: 1px solid #5d4037;
}

.btn-hint:hover {
    background: #5d4037;
}

.btn-confirm {
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
    color: white;
    border: 1px solid #2e7d32;
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #388e3c 0%, #4caf50 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(67, 160, 71, 0.25);
}

/* 统计区域 */
.stats {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.stats h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

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

/* 练习区域 */
.practice-area {
    flex: 1;
    min-width: 0; /* 防止溢出 */
}

.practice-container {
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.initial-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
}

.welcome {
    max-width: 500px;
}

.welcome iconify-icon {
    color: #8d6e63;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.welcome h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.welcome p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 10px;
}

/* 练习状态 */
.practice-state {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hidden {
    display: none !important;
}

.question-header {
    margin-bottom: 25px;
}

.progress {
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #a1887f, #8d6e63);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.2) 100%);
    animation: shimmer 2s infinite;
}

.progress-text {
    text-align: right;
    font-size: 0.9rem;
    color: #666;
}

/* 问题卡片 */
.question-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.question-type {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #efebe9;
    color: #8d6e63;
    padding: 8px 15px;
    border-radius: 30px;
    font-weight: 600;
    margin-bottom: 25px;
    align-self: flex-start;
}

.question-text {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: #2c3e50;
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    padding: 20px;
    background: rgba(255, 255, 255, var(--opacity-text-bg));
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.05);
}

.answer-input {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.answer-input input {
    flex: 1;
    padding: 18px;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, var(--opacity-text-bg));
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    color: #333;
}

.answer-input input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.35);
    border-color: #8d6e63;
    box-shadow:
        0 0 0 3px rgba(141, 110, 99, 0.15),
        inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.hint-area {
    background: rgba(255, 248, 225, 0.4);
    border-left: 3px solid rgba(255, 193, 7, 0.6);
    padding: 15px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 25px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.hint-area p {
    margin: 0;
    color: #856404;
}

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

.actions .btn {
    flex: 1;
    min-width: 140px;
}

/* 结果反馈 */
.result-feedback {
    margin-top: 30px;
}

.feedback {
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    animation: fadeIn 0.5s;
}

.feedback.correct {
    background: rgba(232, 245, 233, 0.4);
    border: 1px solid rgba(76, 175, 80, 0.6);
    backdrop-filter: blur(10px);
}

.feedback.wrong {
    background: rgba(255, 235, 238, 0.4);
    border: 1px solid rgba(244, 67, 54, 0.6);
    backdrop-filter: blur(10px);
}

.feedback iconify-icon {
    width: 4rem;
    height: 4rem;
    margin-bottom: 15px;
}

.feedback.correct iconify-icon {
    color: #4CAF50;
}

.feedback.wrong iconify-icon {
    color: #f44336;
}

.feedback h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.feedback p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.click-hint {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* 图表区域 */
.chart-area {
    flex: 0 0 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab.active {
    color: #8d6e63;
    border-bottom-color: #8d6e63;
}

.tab:hover:not(.active) {
    color: #333;
}

.tab-content {
    position: relative;
    min-height: 350px;
}

.tab-pane {
    animation: fadeIn 0.5s;
}

.chart-description {
    text-align: center;
    font-size: 0.9rem;
    color: #777;
    margin-top: 15px;
}

/* 历史记录列表 */
.history-list {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.history-list h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-list ul {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.history-list li {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
}

.history-list li:last-child {
    border-bottom: none;
}

.history-list .empty {
    color: #999;
    text-align: center;
    font-style: italic;
    justify-content: center;
}

/* 底部样式 */
.footer {
    background: #f8f9fa;
    padding: 20px 30px;
    text-align: center;
    color: #666;
    border-top: 1px solid #eaeaea;
}

.footer p {
    margin-bottom: 10px;
}

.footer-links a {
    color: #8d6e63;
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 40px;
    z-index: 1001;
    text-align: center;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: popIn 0.4s;
    min-width: 400px;
    max-width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(25px) saturate(180%);
}

.correct-modal {
    border: 2px solid rgba(76, 175, 80, 0.7);
}

.modal-content .success-icon {
    width: 5rem;
    height: 5rem;
    color: #4CAF50;
    margin-bottom: 20px;
}

.modal-content h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.modal-answer {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #333;
}

.modal-hint {
    font-size: 0.9rem;
    color: #777;
    font-style: italic;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        flex-wrap: wrap;
    }

    .sidebar {
        flex: 0 0 100%;
        order: 1;
    }

    .practice-area {
        flex: 1 1 100%;
        order: 2;
    }

    .chart-area {
        flex: 0 0 100%;
        order: 3;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .main-content {
        padding: 10px;
    }

    .question-text {
        font-size: 1.8rem;
    }

    .actions .btn {
        min-width: 100%;
    }

    .modal {
        min-width: 300px;
        padding: 30px 20px;
    }
}

/* 透明度控制面板 */
#opacity-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 15px;
    backdrop-filter: blur(15px) saturate(160%);
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.06),
        0 6px 12px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease-in-out;
    min-width: 200px;
    animation: fadeIn 0.5s;
}

#opacity-control:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow:
        0 16px 35px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    border-color: rgba(161, 136, 127, 0.8);
    backdrop-filter: blur(var(--blur-container)) saturate(var(--saturate-container));
}

.control-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #5d4037;
    font-weight: 600;
}

.control-header iconify-icon {
    color: #8d6e63;
    font-size: 1.5rem;
    transition: transform 0.3s ease-in-out;
}

#opacity-control:hover .control-header iconify-icon {
    transform: rotate(15deg) scale(1.1);
}

.control-slider {
    width: 100%;
    margin-bottom: 10px;
}

.control-slider input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.control-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8d6e63 0%, #a1887f 100%);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease-in-out;
}

.control-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.control-slider input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8d6e63 0%, #a1887f 100%);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease-in-out;
}

.control-slider input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.control-value {
    text-align: center;
    font-size: 1.1rem;
    color: #5d4037;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

.control-value span {
    font-family: monospace;
    font-weight: 700;
}

@media (max-width: 768px) {
    #opacity-control {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        width: calc(100% - 20px);
    }
}

/* ============================================
   新样式：历史记录和错误统计
============================================ */

/* 历史记录和错误统计标签页控件 */
.history-controls,
.errors-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.history-controls select,
.errors-controls select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(141, 110, 99, 0.3);
    background: rgba(255, 255, 255, var(--opacity-controls));
    color: #5d4037;
    font-size: 0.95rem;
    backdrop-filter: blur(5px);
    transition: all 0.2s;
}

.history-controls select:hover,
.errors-controls select:hover {
    border-color: #8d6e63;
    background: rgba(255, 255, 255, min(calc(var(--opacity-controls) * 1.67), 1));
}

/* 阈值控制滑块 */
.threshold-control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    border: 1px solid rgba(141, 110, 99, 0.3);
}

.threshold-control label {
    color: #5d4037;
    font-weight: 500;
    white-space: nowrap;
}

.threshold-control input[type="range"] {
    width: 120px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.threshold-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8d6e63 0%, #a1887f 100%);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.threshold-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8d6e63 0%, #a1887f 100%);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#error-threshold-value {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #5d4037;
}

/* 统计卡片 */
.errors-stats-overview {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 120px;
    background: rgba(255, 255, 255, var(--opacity-stat-card));
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(141, 110, 99, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
    transition: all 0.3s;
}

.stat-card:hover {
    background: rgba(255, 255, 255, min(calc(var(--opacity-stat-card) * 1.67), 1));
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.stat-card iconify-icon {
    color: #8d6e63;
    font-size: 1.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: #795548;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #5d4037;
}

/* 表格容器 */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(141, 110, 99, 0.3);
    background: rgba(255, 255, 255, var(--opacity-table-bg));
    backdrop-filter: blur(5px);
    margin-bottom: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

table th {
    background: rgba(141, 110, 99, var(--opacity-table-header));
    color: #5d4037;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid rgba(141, 110, 99, 0.3);
}

table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(141, 110, 99, 0.15);
    color: #5d4037;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background: rgba(255, 255, 255, 0.15);
}

.empty-row td {
    text-align: center;
    color: #795548;
    font-style: italic;
    padding: 30px !important;
}

/* 操作类型样式 */
.action-add {
    color: #4caf50;
    font-weight: 500;
}

.action-delete {
    color: #f44336;
    font-weight: 500;
}

.action-correct {
    color: #2196f3;
    font-weight: 500;
}

.action-wrong {
    color: #ff9800;
    font-weight: 500;
}

.action-skip {
    color: #9c27b0;
    font-weight: 500;
}

.action-default {
    color: #607d8b;
    font-weight: 500;
}

/* 错误级别样式 */
.error-level-high {
    color: #f44336;
    font-weight: 700;
}

.error-level-medium {
    color: #ff9800;
    font-weight: 600;
}

.error-level-low {
    color: #4caf50;
    font-weight: 500;
}

.error-level-none {
    color: #9e9e9e;
    font-weight: 400;
}

/* 分页控件 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#history-page-info {
    color: #5d4037;
    font-weight: 500;
    min-width: 120px;
    text-align: center;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .errors-stats-overview {
        flex-direction: column;
    }

    .stat-card {
        min-width: 100%;
    }

    .history-controls,
    .errors-controls {
        flex-direction: column;
    }

    .threshold-control {
        justify-content: space-between;
    }
}

/* ============================================
   日历选择器组件样式
   ============================================ */

/* 日历容器 */
.calendar-container {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    z-index: 1000;
    background: rgba(255, 255, 255, var(--opacity-calendar));
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(141, 110, 99, 0.1);
    padding: 20px;
    min-width: 300px;
    max-height: 400px;
    overflow-y: auto;
}

.calendar-container.hidden {
    display: none;
}

/* 日历按钮样式 */
#calendar-toggle-btn {
    background: rgba(239, 235, 233, var(--opacity-controls));
    backdrop-filter: blur(5px);
}
#calendar-toggle-btn:hover {
    background: rgba(215, 204, 200, var(--opacity-controls));
}

/* 日历头部 */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-nav-btn {
    background: rgba(141, 110, 99, 0.1);
    border: none;
    border-radius: var(--radius-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #5d4037;
    transition: all var(--transition-base);
}

.calendar-nav-btn:hover {
    background: rgba(141, 110, 99, 0.2);
}

.calendar-nav-btn.disabled,
.calendar-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    /* pointer-events: none; 移除以允许事件冒泡 */
}

.calendar-nav-btn.disabled:hover,
.calendar-nav-btn:disabled:hover {
    background: rgba(141, 110, 99, 0.1);
}

.calendar-month-year {
    font-weight: 600;
    color: #5d4037;
    font-size: 1.1rem;
}

/* 星期标题 */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #a1887f;
    padding: 4px;
}

/* 日期网格 */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: all var(--transition-base);
    color: #5d4037;
    background: rgba(255, 255, 255, 0.3);
    position: relative;
}

.calendar-day:hover {
    background: rgba(141, 110, 99, 0.1);
    transform: translateY(-2px);
}

.calendar-day.selected {
    background: linear-gradient(135deg, #8d6e63 0%, #a1887f 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(141, 110, 99, 0.2);
}

.calendar-day.today {
    border: 2px solid #a1887f;
    background: rgba(161, 136, 127, 0.1);
}

.calendar-day.other-month {
    color: #a1887f;
    opacity: 0.5;
}

/* 日历标记小圆点 */
.add-marker-dot {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #4caf50; /* 使用现有的action-add绿色 */
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.5);
    pointer-events: none;
}

/* 悬停效果增强 */
.calendar-day:hover .add-marker-dot {
    transform: translateX(-50%) scale(1.2);
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.7);
}

/* 在选中和今天状态下的标记 */
.calendar-day.selected .add-marker-dot,
.calendar-day.today .add-marker-dot {
    background-color: #ffffff;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.7);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .add-marker-dot {
        width: 3px;
        height: 3px;
        bottom: 3px;
    }
}

/* 日历底部 */
.calendar-footer {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.calendar-today-btn,
.calendar-clear-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.calendar-today-btn {
    background: rgba(161, 136, 127, 0.1);
    color: #5d4037;
    border: 1px solid rgba(161, 136, 127, 0.3);
}

.calendar-today-btn:hover {
    background: rgba(161, 136, 127, 0.2);
}

.calendar-clear-btn {
    background: rgba(93, 64, 55, 0.1);
    color: #5d4037;
    border: 1px solid rgba(93, 64, 55, 0.3);
}

.calendar-clear-btn:hover {
    background: rgba(93, 64, 55, 0.2);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .calendar-container {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        min-width: 280px;
        max-width: 90vw;
        max-height: 80vh;
        overflow-y: auto;
    }
}

/* 练习日期选择器的日历样式 */
#practice-calendar-container {
    top: auto;
    bottom: 100%;
    margin-bottom: 8px;
    left: 0;
    right: auto;
    min-width: 280px;
    max-width: calc(100vw - 40px);
}

/* ============================================
   学习打卡样式
   ============================================ */
.log-header {
    margin-bottom: 16px;
}

.log-header h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #5d4037;
}

.log-stats {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: #8d6e63;
}

.log-stats strong {
    color: #5d4037;
    font-size: 18px;
}

.log-list-container {
    max-height: 400px;
    overflow-y: auto;
}

.log-list-container .table-container {
    max-height: none;
}

/* ============================================
   计划任务样式
   ============================================ */
.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.plan-header h3 {
    margin: 0;
    font-size: 16px;
    color: #5d4037;
}

.plan-add-form {
    margin-bottom: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(141, 110, 99, 0.2);
}

.plan-add-form.hidden {
    display: none;
}

.plan-add-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(141, 110, 99, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    color: #3e2723;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.plan-add-form textarea:focus {
    outline: none;
    border-color: #8d6e63;
    box-shadow: 0 0 0 2px rgba(141, 110, 99, 0.15);
}

.plan-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.plan-list-container {
    max-height: 400px;
    overflow-y: auto;
}

.plan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(141, 110, 99, 0.15);
    transition: all 0.2s ease;
}

.plan-item:hover {
    background: rgba(255, 255, 255, 0.5);
}

.plan-item.completed .plan-text {
    text-decoration: line-through;
    opacity: 0.5;
}

.plan-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.plan-checkbox {
    cursor: pointer;
    color: #8d6e63;
    font-size: 22px;
    flex-shrink: 0;
    transition: color 0.2s;
}

.plan-checkbox:hover {
    color: #5d4037;
}

.plan-item.completed .plan-checkbox {
    color: #4caf50;
}

.plan-text {
    font-size: 14px;
    color: #3e2723;
    word-break: break-word;
}

.plan-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-left: 12px;
}

.plan-date {
    font-size: 12px;
    color: #a1887f;
    white-space: nowrap;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #a1887f;
    font-size: 18px;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: #e53935;
}

/* ============================================
   手机端响应式 — 全面适配
   ============================================ */

/* ---- 平板及以下 (≤1200px) ---- */
@media (max-width: 1200px) {
    .main-content {
        flex-wrap: wrap;
    }
    .sidebar {
        flex: 0 0 100%;
        order: 1;
    }
    .practice-area {
        flex: 1 1 100%;
        order: 2;
    }
    .chart-area {
        flex: 0 0 100%;
        order: 3;
    }
    .chart-area .tabs {
        flex-wrap: wrap;
    }
    .chart-area .tab {
        flex: 0 1 auto;
        font-size: 13px;
        padding: 10px 12px;
    }
}

/* ---- 手机横屏及以下 (≤768px) ---- */
@media (max-width: 768px) {
    body {
        padding: 4px;
    }
    .container {
        border-radius: 12px;
    }

    .header {
        padding: 16px 14px;
    }
    .header h1 {
        font-size: 1.3rem;
        gap: 8px;
    }
    .header .subtitle {
        font-size: 0.9rem;
    }

    .user-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .main-content {
        padding: 8px;
        gap: 12px;
        min-height: auto;
    }

    .panel {
        padding: 16px;
        border-radius: 12px;
    }
    .panel h2 {
        font-size: 1.1rem;
        margin-bottom: 14px;
    }

    .sidebar {
        gap: 12px;
    }

    textarea, select {
        padding: 10px;
        font-size: 0.95rem;
    }
    textarea {
        min-height: 120px;
    }

    .btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    .btn-small {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .question-text {
        font-size: 1.4rem;
        min-height: 80px;
        padding: 16px;
    }
    .question-type {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    .question-card {
        padding: 16px;
    }
    .answer-input {
        flex-direction: column;
        gap: 10px;
    }
    .answer-input input {
        font-size: 1rem;
        padding: 14px;
    }
    .actions {
        flex-direction: column;
        gap: 8px;
    }
    .actions .btn {
        min-width: 100%;
        flex: none;
    }

    .welcome h3 {
        font-size: 1.3rem;
    }
    .welcome p {
        font-size: 0.95rem;
    }

    .modal {
        min-width: auto;
        width: 90vw;
        padding: 24px 16px;
    }
    .modal-content h2 {
        font-size: 1.5rem;
    }
    .modal-answer {
        font-size: 1.1rem;
    }

    table {
        min-width: auto !important;
    }
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table th, table td {
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    .tabs {
        flex-wrap: wrap;
    }
    .tab {
        flex: 0 1 auto;
        font-size: 12px;
        padding: 8px 10px;
        gap: 4px;
    }

    .log-stats {
        flex-direction: column;
        gap: 4px;
    }
    .log-list-container {
        max-height: 300px;
    }

    .plan-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    .plan-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .plan-item-actions {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }
    .plan-list-container {
        max-height: 300px;
    }

    #opacity-control {
        top: auto;
        bottom: 8px;
        right: 8px;
        left: 8px;
        min-width: auto;
        width: auto;
        padding: 10px 14px;
        border-radius: 12px;
    }
    .control-header {
        margin-bottom: 8px;
        font-size: 13px;
    }

    .calendar-container {
        min-width: 260px;
        max-width: 92vw;
        padding: 14px;
    }
    .calendar-day {
        font-size: 12px;
    }

    .errors-stats-overview {
        flex-direction: column;
    }
    .stat-card {
        min-width: 100%;
    }
    .history-controls,
    .errors-controls {
        flex-direction: column;
    }
    .threshold-control {
        justify-content: space-between;
    }

    .add-word-section {
        margin-top: 16px;
    }
}

/* ---- 小屏手机 (≤480px) ---- */
@media (max-width: 480px) {
    .login-container {
        padding: 28px 18px;
        border-radius: 16px;
    }
    .login-header h1 {
        font-size: 1.4rem;
    }
    .login-field input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    .login-btn {
        padding: 14px;
        font-size: 1rem;
    }

    .header h1 {
        font-size: 1.1rem;
    }
    .header .subtitle {
        font-size: 0.8rem;
    }

    .main-content {
        padding: 4px;
        gap: 8px;
    }

    .panel {
        padding: 12px;
    }

    .question-text {
        font-size: 1.2rem;
        padding: 12px;
        min-height: 60px;
    }

    .tab {
        font-size: 11px;
        padding: 8px;
    }
    .tab iconify-icon {
        font-size: 14px;
    }

    table th, table td {
        padding: 6px 8px;
        font-size: 11px;
    }

    .btn {
        padding: 10px 14px;
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .modal {
        width: 95vw;
        padding: 20px 12px;
    }

    .plan-item-content {
        gap: 8px;
    }
    .plan-text {
        font-size: 13px;
    }
    .plan-date {
        font-size: 11px;
    }
}