/* ============================================
   auth.css - 登录/注册页样式
   ============================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--gradient-bg);
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 36px 24px;
    max-width: 360px;
    width: 100%;
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}
.auth-logo-icon {
    font-size: 48px;
    margin-bottom: 8px;
}
.auth-logo h1 {
    font-size: 26px;
    color: var(--primary);
    font-weight: 800;
}
.auth-logo p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.auth-tabs {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 12px;
}
.auth-tab {
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    padding-bottom: 10px;
    position: relative;
    transition: color 0.2s;
}
.auth-tab.active {
    color: var(--primary);
    font-weight: 700;
}
.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.auth-form .form-group input {
    background: var(--bg);
}

.auth-form .btn {
    margin-top: 8px;
}

/* === 用户首页 === */
.user-home {
    padding: 0 0 32px;
}

.home-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--gradient-primary);
    color: #fff;
}
.home-title {
    font-size: 20px;
    font-weight: 700;
}
.home-logout {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
    margin-top: -20px;
    position: relative;
    z-index: 1;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 18px 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}
.stat-card:active { transform: scale(0.96); }
.stat-num {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}
.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.stat-pink .stat-num   { color: var(--primary); }
.stat-green .stat-num  { color: var(--success); }
.stat-orange .stat-num { color: #FF9800; }
.stat-purple .stat-num { color: #9C27B0; }

/* 进度条 */
.progress-section {
    padding: 0 16px;
    margin-bottom: 20px;
}
.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}
.progress-header span:last-child {
    color: var(--primary);
}
.progress-bar-wrap {
    height: 10px;
    background: var(--primary-bg);
    border-radius: 5px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 5px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 快捷入口 */
.home-actions {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.home-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}
.home-action-btn:active { transform: scale(0.97); }
.home-action-btn.primary {
    background: var(--gradient-primary);
    color: #fff;
}
.home-action-btn.primary .action-text { color: #fff; }
.action-icon {
    font-size: 28px;
}
.action-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* === 知识点列表页 === */
.knowledge-page {
    padding-bottom: 24px;
}

.search-bar {
    padding: 12px 16px;
}
.search-bar input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--card-bg);
    outline: none;
}
.search-bar input:focus {
    border-color: var(--primary);
}

.filter-bar {
    display: flex;
    gap: 8px;
    padding: 0 16px 8px;
}
.filter-select {
    flex: 1;
    padding: 8px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--card-bg);
    outline: none;
}
.filter-select:focus {
    border-color: var(--primary);
}

.kp-list {
    padding: 0 16px;
}

.kp-item {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}
.kp-item:active { transform: scale(0.98); }

.kp-question {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.5;
}

.kp-answer {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kp-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.kp-category {
    font-size: 12px;
    color: var(--text-secondary);
}

.kp-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* === 顶栏多按钮 === */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar-cat-btn {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.topbar-cat-btn:active { color: var(--primary); }

/* === 知识点标签 === */
.kp-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.kp-tag-mastered {
    background: #E0F2F1;
    color: #2A9D8F;
}
.kp-tag-unmastered {
    background: var(--primary-bg);
    color: var(--primary);
}
.kp-tag-diff {
    background: #FFF3E0;
    color: #FF9800;
}

/* === 分页按钮 === */
.page-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
}
.page-btn:active {
    background: var(--primary-bg);
}
.page-info {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 36px;
    padding: 0 4px;
}

/* === 空状态/加载 === */
.loading-tip,
.empty-tip {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-secondary);
    font-size: 14px;
}
.empty-tip p { margin-bottom: 6px; }
.empty-sub {
    font-size: 13px;
    color: var(--text-light);
}

/* === 分类管理弹窗 === */
.category-manage {
    padding-bottom: 8px;
}
.category-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.category-add-row input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
}
.category-add-row input:focus {
    border-color: var(--primary);
}

.category-list {
    max-height: 50vh;
    overflow-y: auto;
}
.cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.cat-item:last-child { border-bottom: none; }
.cat-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cat-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}
.cat-item-count {
    font-size: 12px;
    color: var(--text-secondary);
}
.cat-item-actions {
    display: flex;
    gap: 6px;
}
.cat-rename-btn,
.cat-delete-btn {
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.cat-rename-btn {
    background: var(--primary-bg);
    color: var(--primary);
}
.cat-delete-btn {
    background: #FFEBEE;
    color: #E53935;
}
.cat-rename-btn:active,
.cat-delete-btn:active {
    opacity: 0.7;
}
