/* 教主·教案 - 视觉样式 */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --accent: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-section: #f1f5f9;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-main);
    min-height: 100vh;
    padding: 0 20px 20px 20px;
    color: var(--text-primary);
}

/* 容器 */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

/* 头部 */
.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 16px 32px 12px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.title-wrap h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.title-wrap p {
    font-size: 13px;
    opacity: 0.9;
}

.header-subtitle {
    background: rgba(255,255,255,0.15);
    padding: 3px 12px;
    border-radius: 12px;
    display: inline-block;
    font-size: 14px !important;
    letter-spacing: 0.5px;
}

.version-badge {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
}

/* Token统计卡片 */
.cost-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    border-radius: 12px;
    padding: 14px 30px;
    margin: 16px 32px 0;
    color: white;
    font-family: 'Microsoft YaHei', sans-serif;
}
.cost-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
}
.cost-num {
    font-size: 22px;
    font-weight: bold;
}
.cost-label {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 2px;
}
.cost-highlight .cost-num {
    color: #FFD700;
    font-size: 24px;
}
.cost-divider {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,0.3);
}

/* 标签页导航 */
.tab-nav {
    display: flex;
    background: var(--bg-section);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    margin-top: 16px;
}

.tab-btn {
    flex: 1;
    padding: 16px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    margin: 0 3px;
    background: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    position: relative;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.tab-btn.active {
    color: var(--primary);
    background: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}

.tab-btn.active::after { content: none; }

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 16px 32px 12px 32px;
    max-width: 100%;
}

.tab-panel {
    display: none;
}

.tab-panel.show {
    display: block;
}

/* 表单卡片 */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.form-section {
    margin-bottom: 24px;
}

.form-section:last-of-type {
    margin-bottom: 24px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title .num {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.form-row, .form-row-3 {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-row-3 .form-group {
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group .required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: all 0.2s;
    background: var(--bg-card);
}

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

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* 按钮 */
.btn-generate {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-generate .icon {
    font-size: 18px;
}

/* 加载 */
/* ===== Loading 升级版 ===== */
.loading-wrap {
    display: none;
    padding: 50px 0;
}

.loading-wrap.show {
    display: block;
    animation: loading-fade-in 0.4s ease;
}
@keyframes loading-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading-content {
    text-align: center;
    max-width: 460px;
    margin: 0 auto;
}

/* 双层旋转器 */
.loading-spinner-ring {
    position: relative;
    display: inline-block;
    width: 64px; height: 64px;
    margin-bottom: 20px;
}
.loading-spinner-ring .spinner {
    width: 56px; height: 56px;
    border: 3.5px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    position: absolute; top: 4px; left: 4px;
}
.spinner-pulse {
    position: absolute;
    top: -2px; left: -2px;
    width: 68px; height: 68px;
    border: 2px solid transparent;
    border-top-color: #A78BFA;
    border-radius: 50%;
    animation: spin 2s linear infinite reverse;
    opacity: 0.6;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading标题 */
.loading-title {
    font-size: 18px !important;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 24px !important;
    letter-spacing: 0.5px;
}

/* 动态步骤条 */
.loading-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.loading-step {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 20px;
    background: #F1F5F9;
    color: #94A3B8;
    font-size: 12.5px;
    transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.55;
}
.loading-step .step-icon {
    font-size: 14px;
    transition: transform 0.3s;
}
.loading-step .step-text {
    white-space: nowrap;
    font-weight: 500;
}
.step-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #CBD5E1;
    transition: all 0.35s;
}

/* 步骤激活状态 */
.loading-step.active {
    background: linear-gradient(135deg, #EEF2FF, #EDE9FE);
    color: #4338CA;
    opacity: 1;
    box-shadow: 0 2px 10px rgba(99,102,241,0.15);
    transform: scale(1.05);
}
.loading-step.active .step-icon {
    animation: step-bounce 0.65s ease infinite;
}
@keyframes step-bounce {
    0%, 100% { transform: scale(1) rotate(0); }
    50% { transform: scale(1.25) rotate(8deg); }
}
.loading-step.active .step-dot {
    background: #6366F1;
    box-shadow: 0 0 6px rgba(99,102,241,0.5);
    width: 16px;
    border-radius: 4px;
}

/* 步骤完成状态 */
.loading-step.done {
    background: #ECFDF5;
    color: #059669;
    opacity: 1;
}
.loading-step.done .step-dot {
    background: #10B981;
    width: 16px; border-radius: 4px;
}

/* 进度条 */
.loading-progress-bar {
    height: 4px;
    background: #E2E8F0;
    border-radius: 4px;
    margin-bottom: 12px;
    overflow: hidden;
}
.loading-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #6366F1, #A78BFA, #6366F1);
    background-size: 200% 100%;
    border-radius: 4px;
    transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    animation: progress-shimmer 1.8s ease infinite;
}
@keyframes progress-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-content .sub {
    font-size: 13px;
    color: var(--text-muted);
    min-height: 22px;
}

/* 等待提示 */
.loading-tip {
    font-size: 13px !important;
    color: #CBD5E1 !important;
    margin-top: 6px !important;
    letter-spacing: 0.3px;
}

/* 结果卡片 */
.result-card {
    display: none;
    margin-top: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.result-card.show {
    display: block;
}

.result-header {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.result-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--success);
}

.result-title .icon {
    font-size: 20px;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.btn-action {
    padding: 8px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    background: var(--bg-card);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.btn-action:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-action.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-action.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-action.btn-save {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-action.btn-save:hover {
    background: #059669;
}

.download-dropdown {
    display: inline-block;
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    min-width: 160px;
    overflow: hidden;
}

.dropdown-menu button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: background 0.15s;
}

.dropdown-menu button:hover {
    background: #f3f4f6;
}

/* ===== 结果区目录导航（P1升级）===== */
.result-toc-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    overflow-x: auto;
    flex-wrap: nowrap;
}
.toc-label {
    font-size: 14px;
    color: #64748B;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.toc-items {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
}
.toc-item {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    font-weight: 500;
    color: #475569;
    background: white;
    border: 1.2px solid #E2E8F0;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
    cursor: pointer;
}
.toc-item:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(99,102,241,0.18);
}

/* 字数统计条 */
.result-stats-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 20px;
    background: linear-gradient(to right, #FEFCE8, #FFFBEB);
    border-bottom: 1px solid #FDE68A;
    font-size: 13px;
    color: #92400E;
}
.result-stats-bar b {
    color: #D97706;
}
.stat-divider { opacity: 0.35; }

.result-body {
    padding: 0 20px 20px 20px;
    background: var(--bg-card);
    max-height: 600px;
    overflow-y: auto;
}

/* 教案内容样式 */
.lesson-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
}

.lesson-content h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.lesson-content h2:first-child {
    margin-top: 0;
}

.lesson-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 16px 0 8px;
}

.lesson-content p {
    margin-bottom: 8px;
}

.lesson-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.lesson-content li {
    margin-bottom: 6px;
}

/* 历史记录 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.history-item h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.history-item p {
    font-size: 13px;
    color: var(--text-muted);
}

/* 底部 */
.app-footer {
    padding: 14px 20px 80px;
    text-align: center;
    font-size: 14px;
    color: #94A3B8;
    border-top: 1px solid var(--border);
    background: linear-gradient(to bottom, #F8FAFC, #F1F5F9);
}

.app-footer a {
    color: #6366F1;
    text-decoration: none;
}
.app-footer a:hover { text-decoration: underline; }

.footer-brand {
    font-weight: 700;
    color: #475569;
}
/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 8px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-footer { display: none; }
    .icp-top-bar { font-size: 10px; padding: 2px 6px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

/* ===== 教案库/图书馆专属样式 ===== */

/* 教案库样式 */
.library-search {
    margin-bottom: 16px;
}
.library-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.library-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover {
    border-color: #6366F1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.library-card h4 {
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 8px;
}
.library-card .meta {
    font-size: 13px;
    color: #64748B;
    display: flex;
    gap: 10px;
}
.library-card .preview {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

/* ========== 模板选择弹窗样式 ========== */
.template-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}
.template-modal.show {
    display: flex;
}
.template-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 720px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.template-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}
.template-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.template-close:hover {
    color: #64748b;
}
.template-group {
    margin-bottom: 24px;
}
.template-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.template-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.template-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.template-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.template-card-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.template-card-selected .template-color-preview {
    box-shadow: inset 0 0 0 3px rgba(99,102,241,0.3);
}
.template-color-preview {
    height: 48px;
    border-radius: 0;
}
.template-info {
    padding: 12px;
}
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.template-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.template-tag {
    font-size: 13px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
}
.template-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}
.template-generate-area {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.template-generate-area.show {
    display: block;
}
.template-loading-area {
    display: none;
    text-align: center;
    padding: 16px;
    color: #6366f1;
}
.template-loading-area.show {
    display: block;
}
.btn-generate-template {
    background: #6366f1;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-generate-template:hover {
    background: #4f46e5;
}
.btn-generate-template:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* ===== 资料库样式 ===== */
.lib-container { padding: 16px; }
.lib-header { margin-bottom: 16px; }
.lib-upload-area {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8FAFC;
    margin-bottom: 12px;
}
.lib-upload-area:hover, .lib-upload-area.drag-over {
    border-color: #6366F1;
    background: #EEF2FF;
}
.lib-stats {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lib-type-tag {
    background: #EFF6FF;
    color: #3B82F6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.15s;
}
.lib-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.lib-item-icon { font-size: 28px; flex-shrink: 0; }
.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===== 社区页专属样式 ===== */

/* 教案社区导航 */
.community-search-wrap { padding: 12px 16px; }
.community-search-wrap input {
    width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.community-nav {
    display: flex; gap: 8px; padding: 0 16px 12px;
}
.comm-nav-btn {
    padding: 6px 16px; border: 1px solid #e5e7eb; border-radius: 20px;
    background: white; color: #374151; font-size: 14px; cursor: pointer;
}
.comm-nav-btn.active {
    background: #6366F1; color: white; border-color: #6366F1;
}
.community-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; padding: 0 16px 16px;
}

/* 教案社区卡片 */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.card-meta {
    font-size: 13px;
    color: #64748b;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}
.card-stats span {
    cursor: pointer;
}
.card-stats span:hover {
    color: #6366F1;
}


/* ===== 需求①：PPT成功提示弹窗 ===== */
.ppt-success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}
.ppt-success-tip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    min-width: 320px;
    max-width: 400px;
}
.ppt-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.ppt-success-text {
    flex: 1;
    color: white;
}
.ppt-success-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}
.ppt-success-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.4;
}
.ppt-success-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.ppt-success-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* ===== 管理员后台/认证/设置页专属样式 ===== */

/* ========== 管理员后台样式 ========== */
.admin-sub-tab { padding:10px 20px; border:none; background:none; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.admin-sub-tab:hover { color:#1e293b; }
.admin-sub-tab.active { color:#1e293b; font-weight:700; border-bottom-color:#1e293b; }
.stat-card { background:white; border-radius:12px; padding:20px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size:28px; font-weight:800; color:#1e293b; margin-bottom:4px; }
.stat-card .stat-label { font-size:14px; color:#64748b; font-weight:500; }
#adminUserTable tr, #adminLessonTable tr { border-bottom:1px solid #f1f5f9; transition:bg 0.15s; }
#adminUserTable tr:hover, #adminLessonTable tr:hover { background:#f8fafc; }
#adminUserTable td, #adminLessonTable td { padding:12px 16px; font-size:13px; color:#374151; }
.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:13px; font-weight:600; }
.status-active { background:#dcfce7; color:#166534; }
.status-disabled { background:#fee2e2; color:#991b1b; }
.btn-admin-sm { padding:5px 12px; border:none; border-radius:6px; font-size:14px; cursor:pointer; margin:0 2px; }
.btn-admin-disable { background:#fef2f2; color:#dc2626; }
.btn-admin-enable { background:#f0fdf4; color:#16a34a; }
.btn-admin-del { background:#fefce8; color:#ca8a04; }

/* 付费统计样式 */
.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
}

.cost-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cost-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-highlight {
    color: var(--primary);
    font-size: 15px;
}

/* ===== 用户认证系统样式 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-btn {
    background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #ffffff;
    border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; cursor:pointer;
    backdrop-filter: blur(4px); letter-spacing: 0.5px;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.35); color: white; border-color: white; }
.auth-header-btn-primary { background: #ffffff; color: #4f46e5; font-weight: 700; border-color: #fff;}
.auth-header-btn-primary:hover { background: #f0f0f0; color: #4339cc; }
.auth-username { font-size: 13px; color: #ffffff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; }
.auth-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px; font-size: 15px; color: #64748b; cursor: pointer; margin-bottom: -2px;
}
.auth-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: bold; }
.auth-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: #3b82f6; }
.auth-submit-btn {
    width: 100%; background: #3b82f6; color: white; border: none;
    border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.auth-submit-btn:hover { background: #2563eb; }
.auth-cancel-btn {
    width: 100%; background: #f1f5f9; color: #64748b; border: none;
    border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer;
}
.auth-cancel-btn:hover { background: #e2e8f0; }
.auth-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }
.auth-modal-content {
    max-width: 400px; padding: 28px;
    background: white; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ===== authModal居中定位修复 ===== */
#authModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#registerPromptModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 个人主页展示模式 */
.profile-view .info-row { display:flex; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.profile-view .info-row:last-child { border-bottom:none; }
.profile-view .info-label { width:100px; color:#94a3b8; font-size:14px; flex-shrink:0; }
.profile-view .info-value { color:#1e293b; font-size:14px; font-weight:500; }

/* ===== 偏好设置独立样式 (gp- 前缀，避免全局污染) ===== */
.gp-wrap{max-width:640px;margin:20px auto;}
.gp-header{background:linear-gradient(135deg,#EEF2FF,#F5F3FF);border-radius:14px;padding:20px 24px;margin-bottom:20px;border:1px solid #E0E7FF;}
.gp-header-inner{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.gp-title{font-size:17px;font-weight:700;color:#312E81;}
.gp-subtitle{font-size:13px;color:#6366F1;}
.gp-edit-btn{margin-left:auto;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:5px 14px;font-size:13px;color:#64748B;cursor:pointer;white-space:nowrap;}
.gp-edit-btn:hover{background:#EEF2FF;}
.gp-tip{margin:0;font-size:12px;color:#818CF8;}
.gp-card{background:white;border-radius:14px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.06);border:1px solid #f1f5f9;}
.gp-section{margin-bottom:22px;}
.gp-section:last-of-type{margin-bottom:24px;}
.gp-label{display:block;font-size:14px;font-weight:600;color:#1E293B;margin-bottom:8px;}
.gp-radio-group{display:flex;gap:10px;flex-wrap:wrap;}
.gp-radio-card{display:flex;align-items:center;gap:6px;padding:8px 16px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:14px;color:#475569;user-select:none;}
.gp-radio-card:hover{border-color:#a5b4fc;background:#f8f9ff;}
.gp-radio-card.gp-selected{border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600;box-shadow:0 0 0 2px rgba(99,102,241,0.15);}
.gp-check-group{display:flex;gap:8px;flex-wrap:wrap;}
.gp-check-card{display:flex;align-items:center;gap:6px;padding:8px 14px;border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;transition:all .2s;font-size:13px;color:#475569;user-select:none;}
.gp-check-card:hover{border-color:#a5b4fc;}
.gp-check-card.gp-checked{border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500;}
.gp-textarea{width:100%;padding:12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;color:#374151;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.6;transition:border-color .2s;}
.gp-textarea:focus{outline:none;border-color:#6366F1;}
.gp-actions{display:flex;gap:10px;align-items:center;}
.gp-save-btn{flex:1;padding:12px;border:none;border-radius:10px;background:linear-gradient(135deg,#6366F1,#8B5CF6);color:white;font-size:15px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(99,102,241,0.3);}
.gp-save-btn:disabled{opacity:0.5;cursor:not-allowed;}
.gp-reset-btn{padding:12px 20px;border:1px solid #e2e8f0;border-radius:10px;background:white;color:#64748B;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;}
.gp-reset-btn:hover{border-color:#f87171;color:#ef4444;}
.gp-msg{margin:10px 0 0;font-size:13px;text-align:center;display:none;}

/* 兼容旧类名（重构过渡期） */
.genpref-radio-card.selected{ border-color:#6366F1;background:linear-gradient(135deg,#EEF2FF,#EDE9FE);color:#4338CA;font-weight:600; }
.genpref-check-card.selected{ border-color:#6366F1;background:#EEF2FF;color:#4338CA;font-weight:500; }

/* 偏好面板锁定状态：禁止radio/checkbox卡片点击 */
.gp-locked .genpref-radio-card,
.gp-locked .genpref-check-card{ pointer-events:none;opacity:0.7; }
.lib-item-meta { font-size: 12px; color: #94A3B8; margin-top: 2px; }
.lib-item-del {
    background: none;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #EF4444;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lib-item-del:hover { background: #FEE2E2; }
/* ===== AI画像/分析页专属样式 ===== */

/* ===== AI画像样式 v2 · 精致有温度 ===== */
.ai-portrait-container { padding: 0 20px 20px 20px; margin: 0 auto; }

/* ---- 头部英雄区（渐变+光效+数据概览） ---- */
.portrait-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px; margin-bottom: 20px; color: white;
    position: relative; overflow: hidden;
}
/* 装饰光圈 */
.portrait-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.portrait-hero::after {
    content: ''; position: absolute; bottom: -30px; left: -20px;
    width: 120px; height: 120px; background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portrait-avatar {
    font-size: 42px; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative; z-index: 1;
}
.portrait-info { position: relative; z-index: 1; }
.portrait-info h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.portrait-info p { color: rgba(255,255,255,0.85); margin: 6px 0 0; font-size: 14px; }

/* 右侧快捷统计（英雄区内嵌） */
.portrait-quick-stats {
    display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1;
}
.portrait-qs-item {
    text-align: center; background: rgba(255,255,255,0.14);
    border-radius: 12px; padding: 10px 16px; min-width: 68px;
    backdrop-filter: blur(8px);
}
.portrait-qs-num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.portrait-qs-label { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ---- 数据卡片网格（玻璃态） ---- */
.portrait-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px;
}
.portrait-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 20px 16px; text-align: center; transition: all 0.25s ease;
    position: relative; overflow: hidden;
}
.portrait-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0; transition: opacity 0.25s;
}
.portrait-card:hover { border-color: #C4B5FD; box-shadow: 0 6px 24px rgba(102,126,234,0.12); transform: translateY(-2px); }
.portrait-card:hover::after { opacity: 1; }
.portrait-card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.portrait-card-label { font-size: 12px; color: #94A3B8; margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px; }
.portrait-card-value { font-size: 26px; font-weight: 800; color: #1E293B; line-height: 1; }
.portrait-card-value.small { font-size: 14px; font-weight: 600; color: #64748B; }

/* 空状态 */
.portrait-empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 20px;
    color: #94A3B8;
}

/* ---- 详情区域 ---- */
.portrait-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.portrait-detail-card {
    background: white; border: 1px solid #E8ECF4; border-radius: 14px;
    padding: 18px 20px; transition: all 0.2s;
}
.portrait-detail-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.05); }
.portrait-detail-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #1E293B;
    display: flex; align-items: center; gap: 6px;
}
.portrait-bars { display: flex; flex-direction: column; gap: 10px; }
.portrait-bar-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.bar-label {
    width: 60px; flex-shrink: 0; color: #475569; font-weight: 500;
    text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 10px; background: #F1F5F9; border-radius: 5px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px; transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 5px;
}
.bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.bar-value {
    width: 28px; flex-shrink: 0; color: #64748B; font-weight: 700; font-size: 13px;
}

/* ---- AI标签（彩色胶囊） ---- */
.portrait-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.portrait-tag {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: none; color: white; transition: all 0.2s;
}
.portrait-tag:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
/* 标签颜色分级 */
.tag-purple   { background: linear-gradient(135deg, #667eea, #764ba2); }
.tag-blue     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tag-green    { background: linear-gradient(135deg, #10b981, #34d399); }
.tag-orange   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-pink     { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tag-cyan     { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.tag-default  { background: linear-gradient(135deg, #6366f1, #a78bfa); }

/* ---- AI评语卡片（新增） ---- */
.portrait-insight {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #fdf4ff, #f0f9ff);
    border: 1px solid #e0e7ff; border-radius: 14px; padding: 20px 24px;
    position: relative;
}
.portrait-insight h4 { margin: 0 0 10px; font-size: 15px; color: #6d28d9; }
.portrait-insight-text { font-size: 14px; line-height: 1.8; color: #374151; }
.portrait-insight-text em { font-style: normal; color: #7c3aed; font-weight: 600; }

/* ---- 成就徽章区（新增） ---- */
.portrait-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.portrait-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fefce8; border: 1px solid #fde047;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #854d0e;
}
.portrait-badge.locked { opacity: 0.45; filter: grayscale(1); }
/* ===== 微交互与动效体系 ===== */

/* ===== P3-2 微交互与动效体系 ===== */

/* 全局过渡：Tab切换滑动下划线效果 */
.tab-btn {
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    width: 0; height: 3px;
    background: linear-gradient(to right, #6366F1, #A78BFA);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}
.tab-btn.active::after { width: 70%; }

/* 按钮点击涟漪（通过伪元素实现视觉反馈） */
.btn-generate, .btn-action, .btn-wizard-next {
    position: relative;
    overflow: hidden;
}
.btn-generate:active, .btn-action:active, .btn-wizard-next:active {
    transform: scale(0.97);
}

/* 卡片hover浮起效果增强 */
.form-card, .result-card, .library-card, .community-card {
    transition: box-shadow 0.35s ease, transform 0.25s ease !important;
}
.form-card:hover, .result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
}

/* 页面元素入场渐显（staggered reveal） */
.app-container > header,
.app-container > nav,
.main-content > .tab-panel.show {
    animation: fade-slide-up 0.45s ease both;
}
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单区域入场延迟动画 */
.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.12s; }
.form-section:nth-child(3) { animation-delay: 0.19s; }

/* 推荐卡片交错入场 */
.recommend-card {
    animation: card-pop-in 0.35s ease both;
}
.recommend-card:nth-child(1) { animation-delay: 0.02s; }
.recommend-card:nth-child(2) { animation-delay: 0.07s; }
.recommend-card:nth-child(3) { animation-delay: 0.12s; }
.recommend-card:nth-child(4) { animation-delay: 0.17s; }
.recommend-card:nth-child(5) { animation-delay: 0.22s; }
.recommend-card:nth-child(6) { animation-delay: 0.27s; }
@keyframes card-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 结果区域入场动画 */
.result-card.show {
    animation: result-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes result-reveal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 数字滚动计数动画（AI画像数据使用） */
.portrait-card-value {
    transition: color 0.3s ease;
}
.portrait-card:hover .portrait-card-value {
    color: #6366F1 !important;
}

/* 输入框聚焦光晕 */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* Tab按钮平滑过渡 */
.tab-btn { transition: all 0.25s ease; }

/* 社区卡片悬停微动效升级 */
.community-card {
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s ease;
}
.community-card:hover::before {
    left: 150%;
}

/* 浮动AI按钮脉冲 */
#ai-float-btn {
    animation: float-pulse 2.5s ease-in-out infinite;
}
@keyframes float-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
    50% { transform: scale(1.06); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
}

/* 复制成功提示微动效 */
@keyframes copy-success-bounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 减少动效偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 管理员后台工具类（T11 设计规范统一） ========== */
.admin-muted { color: #94a3b8; font-size: 12px; }
.admin-cell-center { text-align: center; }
.admin-cell-muted { padding: 10px 8px; color: #64748B; font-size: 12px; }
.admin-cell-right { padding: 10px 8px; text-align: right; color: #64748B; font-size: 12px; }
.admin-empty { padding: 30px; text-align: center; color: #94a3b8; }
.admin-error { padding: 30px; text-align: center; color: #ef4444; }
.admin-border-btm { border-bottom: 1px solid #f1f5f9; }
.admin-cost { padding: 10px 8px; text-align: right; color: #ef4444; font-weight: 600; font-size: 12px; }
.admin-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 子标签页激活/非激活状态 */
.sub-tab-active { background: #4f46e5 !important; color: white !important; border: none !important; }
.sub-tab-inactive { background: white !important; color: #374151 !important; border: 1px solid #e2e8f0 !important; }

/* 消息提示颜色 */
.msg-success { color: #059669 !important; }
.msg-error { color: #dc2626 !important; }

select:disabled, textarea:disabled, input:disabled { 
    background:#f1f5f9 !important; 
    color:#94a3b8 !important; 
    cursor:not-allowed; 
    border-color:#e2e8f0 !important;
}

/* ===== 响应式布局 ===== */

/* 响应式 */
/* ===== P2 移动端优化 ===== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { border-radius: var(--radius-md); }

    .app-header { padding: 18px 20px; gap: 12px; }
    .title-wrap h1 { font-size: 19px; letter-spacing: 0.5px; }
    .header-subtitle { display: block; font-size: 12px; }

    .main-content { padding: 12px; }

    /* Tab导航：移动端可滑动 */
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding: 0 4px; margin-top: 8px; }
    .tab-btn { padding: 14px 10px; font-size: 16px; flex: none; flex-shrink: 0; min-width: 56px; border-width: 1.5px; border-radius: 8px; margin: 0 2px; }

    /* 表单移动端优化 */
    .form-row-3 { flex-direction: row; gap: 8px; }
    .form-card input, .form-card select, .form-card textarea, .form-card .custom-select-wrapper {
        min-height: 44px !important; /* 触摸友好 */
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    .btn-generate {
        height: 48px !important;
        font-size: 17px !important;
    }

    /* 智能推荐卡片移动端：单列，最多显示4个 */
    .recommend-cards { grid-template-columns: 1fr !important; }
    .recommend-card:nth-child(n+5) { display: none; }

    /* 结果区移动端 */
    .result-actions { flex-wrap: wrap; gap: 6px; }
    .result-toc-bar { flex-wrap: wrap; padding: 8px 14px; gap: 6px; }
    .toc-label { width: 100%; margin-bottom: 2px; }
    .toc-items { flex-wrap: wrap; }
    .result-stats-bar { flex-wrap: wrap; justify-content: center; font-size: 11.5px; padding: 8px 14px; }
    .stat-divider { display: none; }

    /* 教案预览区撑满屏幕（去除外层padding挤压） */
    #tab-create { padding-left: 0 !important; padding-right: 0 !important; }
    .result-card { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-left: none !important; border-right: none !important; border-radius: 0 !important; }
    .result-header { padding-left: 10px !important; padding-right: 10px !important; }
    .result-body { padding-left: 8px !important; padding-right: 8px !important; }

    /* Loading移动端 */
    .loading-steps { gap: 5px; }
    .loading-step { padding: 5px 10px; font-size: 11px; }
    .loading-step .step-text { display: none; } /* 小屏只显示图标和点 */

    /* AI聊天窗口移动端 */
    #ai-chat-window {
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        left: 8px !important;
        transform: none !important;
        width: calc(100% - 16px) !important;
        max-height: 85vh; height: 75vh;
        border-radius: 16px !important;
    }
    .ai-quick-actions { gap: 4px; padding: 6px 10px; }
    .ai-quick-btn { font-size: 11px; padding: 4px 10px; }

    /* Token统计移动端 */
    .cost-banner { margin: 16px 20px 0; padding: 12px 16px; }
    .cost-item { padding: 0 10px; }
    .cost-num { font-size: 18px; }
    .cost-highlight .cost-num { font-size: 20px; }

    /* 社区网格移动端：单列 */
    .community-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    body { padding: 4px; }
    .app-header { padding: 12px 14px; }
    .logo { width: 40px; height: 40px; }
    .title-wrap h1 { font-size: 17px; }
    .main-content { padding: 8px; }
    .form-section-title { font-size: 15px; }

    .tab-nav { padding: 0 2px; margin-top: 6px; }
    .tab-btn { padding: 12px 8px; font-size: 15px; min-width: 52px; border-width: 1.5px; border-radius: 8px; margin: 0 1px; }

    /* 操作按钮更紧凑 */
    .btn-action { padding: 6px 10px !important; font-size: 12px !important; border: 2px solid #E2E8F0 !important; border-radius: 8px !important; }
}

/* 滚动条 */
.result-body::-webkit-scrollbar {
    width: 8px;
}

.result-body::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.result-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.result-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== P3-1 向导式步骤条 ===== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 14px;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}
.wizard-num {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #E2E8F0;
    color: #64748B;
    transition: all 0.35s ease;
}
.wizard-label { white-space: nowrap; }
/* 步骤激活 */
.wizard-step-item.active { color: #4338CA; }
.wizard-step-item.active .wizard-num {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
    transform: scale(1.08);
}
/* 步骤完成 */
.wizard-step-item.done { color: #059669; }
.wizard-step-item.done .wizard-num {
    background: #10B981;
    color: white;
}
/* 连接线 */
.wizard-line {
    width: 32px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 2px;
    margin: 0 4px;
    transition: all 0.4s ease;
}
.wizard-line.done {
    background: linear-gradient(to right, #10B981, #A7F3D0);
}

/* 向导导航按钮 */
.btn-wizard-next {
    display: block; width: 100%;
    padding: 11px 20px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.btn-wizard-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99,102,241,0.3);
}
.btn-wizard-prev {
    padding: 8px 18px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-wizard-prev:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

/* 向导最终面板 */
.wizard-final-panel {
    text-align: center !important;
}

/* 双渠道操作栏 */
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.channel-select {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.channel-select:focus {
    outline: none;
    border-color: #6366F1;
}
.channel-select option {
    padding: 6px;
}
.btn-doubao {
    padding: 12px 18px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    color: #64748B;
    font-size: 13px;
    font-family: 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-doubao:hover {
    border-color: #6366F1;
    color: #6366F1;
}

/* Token统计 - 老师档案内嵌版 */
.stats-mini {
    margin-top: 24px;
    padding: 0 20px 20px 20px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 14px;
    border: 1px solid #DDD6FE;
}
.stats-mini h3 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #7C3AED;
    font-weight: 600;
}
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stats-mini .stat-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 10px;
}
.stats-mini .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #6366F1;
}
.stats-mini .stat-fee {
    color: #D97706 !important;
}
.stats-mini .stat-label {
    font-size: 13px;
    color: #94A3B8;
}
.stats-mini-last {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
}


/* 智能推荐区 */
.recommend-area {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.recommend-title {
    font-size: 13px;
    font-weight: 600;
    color: #4338CA;
}
.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #C7D2FE; }
.recommend-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.recommend-card {
    width: 100%;
}
.recommend-loading {
    text-align: center;
    padding: 16px;
    color: #6366F1;
    font-size: 13px;
}
.recommend-card {
    background: white;
    border: 1.5px solid #E0E7FF;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-card:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
    transform: translateY(-1px);
}
.recommend-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.recommend-card-body { flex: 1; }
.recommend-card-topic {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}
.recommend-card-meta {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 2px;
}
.recommend-card-reason {
    font-size: 12px;
    color: #A78BFA;
    margin-top: 4px;
    font-style: italic;
}
.recommend-card-arrow {
    color: #C7D2FE;
    font-size: 18px;
}

/* AI智能标识 */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}

/* 智能推荐卡片增强 */
.recommend-card-smart {
    position: relative;
    overflow: hidden;
}
.recommend-card-smart::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366F1, #A78BFA);
    border-radius: 3px 0 0 3px;
}
.recommend-card-smart:hover {
    border-color: #6366F1 !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18) !important;
    transform: translateY(-2px) !important;
}

/* 刷新按钮升级 */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
    color: #6366F1;
    padding: 5px 12px !important;
    background: white !important;
    border: 1.5px solid #C7D2FE !important;
    border-radius: 16px;
    transition: all 0.25s ease;
    font-weight: 500;
}
.btn-refresh:hover {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
    transform: scale(1.05);
}

/* 推荐加载动画 */
.recommend-loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #E0E7FF;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: rec-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* 参考资料上传区 */
.upload-area {
    background: #FAFAFA;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.upload-title { font-size: 13px; font-weight: 600; color: #475569; }
.btn-upload-label {
    background: white;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-upload-label:hover { border-color: #6366F1; color: #6366F1; }
.upload-list { display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-item-icon { font-size: 18px; }
.upload-item-name { flex: 1; color: #334155; }
.upload-item-size { color: #94A3B8; font-size: 11px; }
.upload-item-del {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.upload-item-del:hover { background: #FEE2E2; border-radius: 4px; }

/* 参考附件勾选区 */
.ref-files-area {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.ref-files-label { font-size: 12px; color: #92400E; font-weight: 600; margin-bottom: 8px; }
.ref-files-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-file-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #FDE68A;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: #92400E;
    cursor: pointer;
    transition: all 0.2s;
}
.ref-file-chip input { display: none; }
.ref-file-chip.checked {
    background: #FEF3C7;
    border-color: #F59E0B;
}


/* ===== 历史/库操作按钮 ===== */
.history-item {
    display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.history-item:hover { background: var(--bg-section); }
.history-main { flex: 1; overflow: hidden; }
.history-topic { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.history-meta { font-size: 13px; color: var(--text-muted); }
.history-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

.library-card { position: relative; }
.library-main { cursor: pointer; }
.library-actions { position: absolute; top: 8px; right: 8px; }

.action-btn { background: none; border: none; cursor: pointer; font-size: 26px; padding: 6px; border-radius: 6px; transition: background 0.15s; line-height: 1; }
.action-btn:hover { background: var(--bg-section); }
.star-btn { color: #D1D5DB; }
.star-btn.starred { color: #F59E0B; }
.star-btn:not(.starred) { color: #D1D5DB; }
.del-btn { color: #D1D5DB; }
.del-btn:hover { color: #EF4444; background: #FEF2F2; }
.edit-btn { color: #D1D5DB; }
.edit-btn:hover { color: #4338CA; background: #EEF2FF; }

/* ===== 参考附件删除按钮 ===== */
.ref-file-chip { position: relative; }
.ref-file-chip-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #FDE68A; color: #92400E; font-size: 12px; font-weight: 700;
    cursor: pointer; margin-left: 4px; line-height: 1; transition: all 0.15s;
}
.ref-file-chip-del:hover { background: #EF4444; color: #fff; }

/* ===== 预览弹窗 ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 0 20px 20px 20px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #E2E8F0; }
.modal-title { font-size: 18px; font-weight: 700; color: #1E293B; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #94A3B8; padding: 4px 8px; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: #F1F5F9; color: #1E293B; }
.modal-meta { padding: 8px 24px 12px; font-size: 13px; color: #64748B; border-bottom: 1px solid #F1F5F9; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.8; color: #334155; }
.modal-body h2 { font-size: 16px; color: #6366F1; margin: 16px 0 8px; border-left: 4px solid #6366F1; padding-left: 10px; }
.modal-body h3 { font-size: 15px; color: #4F46E5; margin: 12px 0 6px; }
.modal-body h4 { font-size: 14px; color: #7C3AED; margin: 10px 0 4px; }
.modal-body p { margin: 0 0 8px; }
.modal-body strong { color: #1E293B; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #E2E8F0; justify-content: flex-end; flex-wrap: wrap; }
.btn-modal-edit, .btn-modal-star, .btn-modal-del { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.2s; }
.btn-modal-edit { background: #EEF2FF; color: #4338CA; } .btn-modal-edit:hover { background: #E0E7FF; }
.btn-modal-star { background: #FFFBEB; color: #B45309; } .btn-modal-star:hover { background: #FEF3C7; } .btn-modal-star.starred { background: #FFFBEB; color: #F59E0B; }
.btn-modal-del { background: #FEF2F2; color: #DC2626; } .btn-modal-del:hover { background: #FEE2E2; }

/* ===== 眼睛按钮 ===== */
.eye-btn { color: #D1D5DB; } .eye-btn:hover { color: #6366F1; background: #EEF2FF; }
.history-main { cursor: pointer; }


/* ===== v1.2: 教案内容美化 ===== */
.lesson-content-box {
    padding: 12px 0;
    line-height: 1.8;
    color: #374151;
}
.lesson-section-title {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0 10px;
    font-size: 1.05em;
}
.lesson-subtitle {
    color: #4b5563;
    font-size: 0.95em;
    padding: 4px 16px;
    border-left: 2px solid #d1d5db;
    margin: 8px 0;
}
.lesson-step {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 8px;
}
.step-num {
    color: #6b7280;
    flex-shrink: 0;
    width: 20px;
}

/* 上传文件预览按钮 */
.upload-item-preview {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #6366F1;
    border-radius: 4px;
    transition: background 0.15s;
}
.upload-item-preview:hover {
    background: #EEF2FF;
}

/* 类型标签样式 */
.tag-doc {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}
.tag-ppt {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-left: 8px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* 教案卡片头部 */
.library-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.library-card-header h4 {
    margin: 0;
    flex: 1;
}

/* 教案库标签切换 */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.library-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.library-tabs .tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.library-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .portrait-grid { grid-template-columns: 1fr; }
    .portrait-section { grid-template-columns: 1fr; }
    .portrait-hero { flex-direction: column; text-align: center; }
    .portrait-quick-stats { margin-left: 0; justify-content: center; margin-top: 12px; width: 100%; }
    .portrait-qs-item { flex: 1; }
    .lib-item-name { max-width: 160px; }

    /* 向导步骤移动端 */
    .wizard-steps { padding: 12px 10px; gap: 0; }
    .wizard-step-item { padding: 5px 8px; font-size: 11.5px; }
    .wizard-label { display: none; } /* 小屏只显示数字 */
    .wizard-num { width: 22px; height: 22px; font-size: 10px; }
    .wizard-line { width: 16px; }
}

#onboardingGuide{display:none!important}
