/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition);
    white-space: nowrap;
    user-select: none;
}

.btn:active { transform: scale(0.96); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }

.btn-danger-outline { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn-danger-outline:hover { background: var(--danger-light); }

.btn-text { background: transparent; color: var(--text-secondary); padding: 6px 8px; }
.btn-text:hover { color: var(--primary); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:active { transform: none; }

/* ===== 天气栏 ===== */
.weather-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #4A90D9, #6BA5E7);
    color: #fff;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.weather-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.weather-city { font-size: 14px; font-weight: 600; }
.weather-temp { font-size: 22px; font-weight: 700; }
.weather-desc { font-size: 13px; opacity: 0.9; }
.weather-icon { font-size: 36px; }

/* ===== 待办事项 ===== */
.todo-input-area {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.todo-input {
    flex: 1;
    padding: 11px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition);
}

.todo-input:focus { border-color: var(--primary); }

.todo-list { margin-bottom: 16px; }

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    animation: slideIn 0.25s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}

.todo-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.todo-checkbox:hover { border-color: var(--primary); }
.todo-checkbox.checked { background: var(--success); border-color: var(--success); }
.todo-checkbox.checked::after { content: '✓'; color: #fff; font-size: 14px; font-weight: 700; }

.todo-text { flex: 1; font-size: 15px; word-break: break-word; }
.todo-text.completed { text-decoration: line-through; color: var(--text-light); }

.todo-delete {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all var(--transition);
    flex-shrink: 0;
}

.todo-delete:hover { background: var(--danger-light); color: var(--danger); }

.todo-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.todo-remaining { font-size: 14px; color: var(--text-secondary); }

.todo-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
}
.todo-empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ===== 速记卡 ===== */
.qc-book-list { display: grid; gap: 12px; }

.qc-book-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qc-book-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.qc-book-info { flex: 1; }
.qc-book-name { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.qc-book-meta { font-size: 13px; color: var(--text-secondary); }

.qc-book-actions { display: flex; gap: 8px; }

.qc-card-list { display: grid; gap: 10px; }

.qc-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition);
}

.qc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
}

.qc-card-title { font-size: 15px; font-weight: 600; flex: 1; }
.qc-card-arrow { color: var(--text-light); transition: transform var(--transition); }
.qc-card.expanded .qc-card-arrow { transform: rotate(180deg); }

.qc-card-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 16px;
}

.qc-card.expanded .qc-card-content {
    max-height: 500px;
    padding: 0 16px 14px;
}

.qc-card-content-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.qc-card-actions { display: flex; gap: 8px; margin-top: 8px; }

.qc-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.qc-book-title { flex: 1; font-size: 20px; font-weight: 700; }

/* ===== 笔记本 ===== */
.nb-note-list { display: grid; gap: 12px; }

.nb-note-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    cursor: pointer;
}

.nb-note-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.nb-note-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.nb-note-preview { font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-note-meta { font-size: 12px; color: var(--text-light); margin-top: 8px; display: flex; gap: 12px; }
.nb-note-actions { display: flex; gap: 8px; margin-top: 8px; }

.nb-editor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.nb-title-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 18px;
    font-weight: 600;
    outline: none;
}

.nb-title-input:focus { border-color: var(--primary); }

.nb-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}

.tool-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--transition);
}

.tool-btn:hover { background: var(--primary-bg); }
.tool-btn.active { background: var(--primary); color: #fff; }

.tool-select {
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    background: #fff;
}

.tool-color {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px;
}

.nb-index-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--warning-light);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.nb-index-label { font-size: 13px; color: var(--warning); font-weight: 600; }
.nb-index-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #fff;
    border: 1px solid var(--warning);
    border-radius: 12px;
    font-size: 12px;
    color: var(--warning);
    cursor: pointer;
}
.nb-index-tag-close { font-size: 14px; line-height: 1; }

.nb-editor {
    min-height: 300px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    outline: none;
    font-size: 15px;
    line-height: 1.8;
    overflow-y: auto;
}

.nb-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--text-light);
}

.nb-editor img { max-width: 100%; border-radius: var(--radius-md); margin: 8px 0; }
.nb-editor mark { background: #FFF3B0; padding: 1px 3px; border-radius: 2px; }

/* ===== 英语学习 ===== */
.en-book-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.en-book-tab {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    transition: all var(--transition);
}

.en-book-tab:hover { border-color: var(--primary); }
.en-book-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.en-sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.en-sub-tab {
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.en-sub-tab.active { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }

.en-flashcard {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.en-flashcard:hover { box-shadow: var(--shadow-lg); }

.en-card-word { font-size: 32px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.en-card-phonetic { font-size: 16px; color: var(--text-secondary); margin-bottom: 16px; }
.en-card-meaning { font-size: 18px; color: var(--primary); line-height: 1.6; }

.en-card-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.en-progress { text-align: center; }
.en-progress span { font-size: 13px; color: var(--text-secondary); }

.en-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 6px;
    overflow: hidden;
}

.en-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.en-fav-list { display: grid; gap: 8px; }

.en-fav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.en-fav-word { font-size: 16px; font-weight: 600; flex-shrink: 0; }
.en-fav-meaning { font-size: 14px; color: var(--text-secondary); flex: 1; }
.en-fav-remove { color: var(--text-light); font-size: 18px; transition: color var(--transition); }
.en-fav-remove:hover { color: var(--danger); }

/* ===== 番茄时钟 ===== */
.pomo-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: center;
}

.pomo-mode-tab {
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    transition: all var(--transition);
}

.pomo-mode-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.pomo-timer-container { display: flex; flex-direction: column; align-items: center; }

.pomo-timer-ring {
    position: relative;
    width: 220px;
    height: 220px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pomo-ring-svg { transform: rotate(-90deg); width: 100%; height: 100%; }

.pomo-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}

.pomo-ring-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.pomo-mode-tab[data-mode="break"].active,
.pomo-timer-container.break-mode .pomo-ring-progress { stroke: var(--success); }

.pomo-time-display {
    position: absolute;
    font-size: 42px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.pomo-controls { display: flex; gap: 12px; margin-bottom: 30px; }

.pomo-stats {
    display: flex;
    gap: 40px;
}

.pomo-stat-item { text-align: center; }
.pomo-stat-num { display: block; font-size: 28px; font-weight: 700; color: var(--primary); }
.pomo-stat-label { font-size: 13px; color: var(--text-secondary); }

/* ===== 考试倒计时 ===== */
.exam-list { display: grid; gap: 12px; }

.exam-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition);
}

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

.exam-card.urgent { border-left: 4px solid var(--danger); }
.exam-card.warning { border-left: 4px solid var(--warning); }
.exam-card.normal { border-left: 4px solid var(--success); }

.exam-info { flex: 1; }
.exam-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.exam-date { font-size: 13px; color: var(--text-secondary); }

.exam-countdown { text-align: center; margin: 0 20px; }
.exam-days { font-size: 36px; font-weight: 700; line-height: 1; }
.exam-days-label { font-size: 12px; color: var(--text-secondary); }

.exam-card.urgent .exam-days { color: var(--danger); }
.exam-card.warning .exam-days { color: var(--warning); }
.exam-card.normal .exam-days { color: var(--success); }

.exam-actions { display: flex; flex-direction: column; gap: 6px; }

/* ===== 弹窗 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { font-size: 24px; color: var(--text-light); width: 32px; height: 32px; }
.modal-close:hover { color: var(--danger); }

.modal-body { padding: 20px; overflow-y: auto; }

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

/* 弹窗表单 */
.modal-input-group { margin-bottom: 14px; }
.modal-label { display: block; font-size: 14px; color: var(--text-secondary); margin-bottom: 6px; }
.modal-input, .modal-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition);
}
.modal-input:focus, .modal-textarea:focus { border-color: var(--primary); }
.modal-textarea { resize: vertical; min-height: 80px; }

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(44,62,80,0.92);
    color: #fff;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 15px; }

/* ===== 登录页 ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #4A90D9 0%, #357ABD 100%);
    padding: 20px;
}
.login-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-icon { font-size: 48px; display: block; }
.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0 4px;
}
.login-subtitle { font-size: 13px; color: var(--text-light); }
.login-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}
.login-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    font-size: 15px;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.login-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-input {
    padding: 12px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
.login-input:focus { border-color: var(--primary); }
.login-submit-btn { width: 100%; padding: 12px; font-size: 16px; margin-top: 4px; }
.login-error { color: #e74c3c; font-size: 13px; text-align: center; min-height: 18px; }
.login-hint { text-align: center; font-size: 12px; color: var(--text-light); margin-top: 16px; }

/* ===== 侧边栏用户信息 ===== */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    margin-bottom: 8px;
}
.user-avatar { font-size: 18px; }
.user-name { font-size: 13px; color: rgba(255,255,255,0.9); }
.logout-btn { width: 100%; font-size: 12px; }

/* ===== 移动端用户栏（默认隐藏） ===== */
.mobile-user-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.mobile-user-name { font-size: 13px; color: var(--text-secondary); }
