/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --bg-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ==================== 背景装饰 ==================== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.circle-2 {
    width: 200px;
    height: 200px;
    top: 50%;
    right: -100px;
    animation-delay: 5s;
}

.circle-3 {
    width: 250px;
    height: 250px;
    bottom: -125px;
    left: 30%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.8;
    }
}

/* ==================== 容器 ==================== */
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== 头部导航 ==================== */
.header {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 28px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.nav-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-btn i {
    font-size: 16px;
}

/* ==================== 页面布局 ==================== */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* ==================== 英雄区域 ==================== */
.hero-section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 15px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 600;
}

.hero-description {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 40px;
}

/* ==================== 特性卡片 ==================== */
.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 50px 0;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    box-shadow: var(--shadow-md);
}

.feature-card h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 20px;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==================== 按钮样式 ==================== */
.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

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

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

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

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-outline:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-outline:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #718096;
}

.input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: var(--transition);
    background: white;
    color: var(--text-primary);
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-group .btn {
    border-radius: 10px;
    padding: 12px 16px;
}

/* ==================== 表单容器 ==================== */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-icon {
    font-size: 48px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.form-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.form-header p {
    color: var(--text-secondary);
}

.modern-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group label i {
    color: #667eea;
    font-size: 16px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: var(--transition);
    background: white;
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #718096;
    font-style: italic;
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.info-message {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-primary);
    margin-top: 10px;
}

.info-message i {
    color: #667eea;
    font-size: 16px;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.form-footer p {
    color: var(--text-secondary);
    font-size: 14px;
}

.form-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.form-footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* ==================== 写作页面 ==================== */
.writing-container {
    max-width: 1000px;
    margin: 0 auto;
}

.login-prompt {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
}

.login-card i {
    font-size: 64px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.login-card h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.login-input-group {
    display: flex;
    max-width: 400px;
    margin: 0 auto;
    gap: 10px;
}

.login-input-group input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
}

.login-input-group button {
    padding: 14px 28px;
}

.writing-area {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
}

.writing-header {
    margin-bottom: 30px;
}

.topic-display {
    background: white;
    border-radius: 16px;
    padding: 30px;
    border: 2px solid var(--border-color);
}

.topic-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-gradient);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.current-topic .topic-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.current-topic .topic-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
}

.word-requirement {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4facfe;
    font-weight: 600;
}

/* ==================== 写作统计 ==================== */
.writing-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.stat-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

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

/* ==================== 编辑器 ==================== */
.editor-container {
    background: white;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    margin-bottom: 30px;
    overflow: hidden;
}

.editor-header {
    background: var(--primary-gradient);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.essay-textarea {
    width: 100%;
    min-height: 400px;
    padding: 20px;
    border: none;
    font-size: 16px;
    line-height: 1.8;
    resize: vertical;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

.essay-textarea:focus {
    outline: none;
}

.writing-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* ==================== 学生档案 ==================== */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
}

.profile-content {
    animation: fadeIn 0.3s ease;
}

.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.profile-header i {
    font-size: 48px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.profile-header h2 {
    font-size: 32px;
    color: var(--text-primary);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.dashboard-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    background: var(--primary-gradient);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header i {
    font-size: 20px;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.card-content {
    padding: 25px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.info-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 6px;
}

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

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.stat-item-compact {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--border-color);
}

.stat-item-compact .stat-value {
    font-size: 28px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

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

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

.essay-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border-left: 4px solid #4facfe;
    transition: var(--transition);
}

.essay-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.essay-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 16px;
}

.essay-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

/* ==================== 提示消息 ==================== */
.toast {
    position: fixed;
    top: 30px;
    right: 30px;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateX(400px);
    transition: var(--transition);
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* ==================== 档案页面优化样式 ==================== */

/* 紧凑的基本信息网格 */
.info-grid-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px;
}

.info-item-compact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label-compact {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

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

/* 优化的作文历史项 */
.essay-list-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 12px;
}

.essay-item-interactive {
    background: var(--gradient-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.essay-item-interactive::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
}

.essay-item-interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.essay-item-interactive:hover::before {
    opacity: 1;
}

.essay-header-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.essay-title-compact {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.essay-meta-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.essay-meta-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.essay-score-badge {
    background: var(--gradient-primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 作文详情模态框 */
.essay-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.essay-modal.show {
    display: flex;
}

.essay-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.essay-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--gradient-light);
}

.essay-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.essay-modal-close {
    background: white;
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.essay-modal-close:hover {
    background: var(--gradient-light);
    color: var(--primary-color);
    transform: rotate(90deg);
}

.essay-modal-body {
    padding: 24px;
}

.essay-detail-section {
    margin-bottom: 20px;
}

.essay-detail-section:last-child {
    margin-bottom: 0;
}

.essay-detail-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.essay-detail-content {
    background: var(--gradient-light);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.essay-content-text {
    line-height: 1.8;
    color: var(--text-primary);
    font-size: 15px;
    white-space: pre-wrap;
    word-break: break-word;
}

.essay-annotation-editor {
    min-height: 160px;
    background: white;
    border-radius: 10px;
    border: 1px dashed var(--border-color);
    padding: 14px;
    user-select: text;
}

.essay-annotation-mark {
    text-decoration: underline 2px #f59e0b;
    text-underline-offset: 4px;
    background: rgba(245, 158, 11, 0.14);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.essay-annotation-mark:hover,
.essay-annotation-mark.active {
    background: rgba(245, 158, 11, 0.24);
}

.annotation-helper-text {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.annotation-composer {
    margin-top: 14px;
    padding: 14px;
    background: #fffaf0;
    border: 1px solid #fcd34d;
    border-radius: 10px;
}

.annotation-selected-text {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 14px;
}

.annotation-composer textarea {
    width: 100%;
    min-height: 88px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 10px;
}

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

.annotation-detail-card {
    margin-top: 14px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

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

.annotation-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
}

.annotation-detail-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.annotation-detail-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.annotation-detail-comment {
    color: var(--text-primary);
    line-height: 1.7;
    white-space: pre-wrap;
}

.annotation-detail-actions {
    margin-top: 12px;
}

.student-annotation-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.student-annotation-item {
    padding: 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.student-annotation-quote {
    margin-bottom: 8px;
    color: #92400e;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    padding: 8px 10px;
    border-radius: 6px;
}

.student-annotation-comment {
    color: var(--text-primary);
    line-height: 1.7;
    white-space: pre-wrap;
}

.essay-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .essay-detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.essay-detail-item {
    text-align: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.essay-detail-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.essay-detail-label-small {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 为提交日期字段提供更多空间 */
#modal-essay-date {
    font-size: 14px;
    font-weight: 600;
}

#modal-essay-date + .essay-detail-label-small {
    font-size: 10px;
}

/* 空状态优化 */
.empty-state-compact {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state-compact .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state-compact .empty-text {
    font-size: 15px;
    margin-bottom: 4px;
}

.empty-state-compact .empty-subtext {
    font-size: 13px;
    opacity: 0.7;
}

.toast.success {
    border-left: 4px solid #4facfe;
}

.toast.error {
    border-left: 4px solid #f5576c;
}

.toast.info {
    border-left: 4px solid #667eea;
}

.toast i {
    font-size: 20px;
}

.toast.success i {
    color: #4facfe;
}

.toast.error i {
    color: #f5576c;
}

.toast.info i {
    color: #667eea;
}

.toast-message {
    font-weight: 500;
    color: var(--text-primary);
}

/* ==================== 认证状态控制 ==================== */
.auth-hidden {
    display: none !important;
}

.auth-required {
    display: inline-flex !important;
}

/* 当用户已登录时 */
body.authenticated .auth-hidden {
    display: none !important;
}

body.authenticated .auth-required {
    display: inline-flex !important;
}

/* 当用户未登录时 */
body:not(.authenticated) .auth-hidden {
    display: inline-flex !important;
}

body:not(.authenticated) .auth-required {
    display: none !important;
}
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .nav {
        width: 100%;
        justify-content: center;
    }

    .nav-btn span {
        display: none;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-section {
        padding: 40px 25px;
    }

    .feature-cards {
        grid-template-columns: 1fr;
    }

    .form-card {
        padding: 30px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .writing-stats {
        grid-template-columns: 1fr;
    }

    .login-input-group {
        flex-direction: column;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .writing-actions {
        flex-direction: column;
    }

    .toast {
        right: 15px;
        left: 15px;
    }
}

/* ==================== 主题列表样式 ==================== */
.topic-list-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.topic-list-header i {
    color: #667eea;
}

.topic-count-badge {
    background: var(--primary-gradient);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.topic-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

.topic-list::-webkit-scrollbar {
    width: 6px;
}

.topic-list::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 3px;
}

.topic-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.topic-item {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.topic-item:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.topic-item-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.topic-number {
    background: var(--primary-gradient);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.topic-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.topic-item-info {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.topic-word-count {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #4facfe;
    font-weight: 500;
}

.topic-item-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.topic-select-btn {
    width: 100%;
    margin-top: 10px;
    opacity: 0;
    transition: var(--transition);
}

.topic-item:hover .topic-select-btn {
    opacity: 1;
}

.no-topics-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.no-topics-message i {
    display: block;
    margin: 0 auto 15px;
}

.no-topics-message p {
    font-size: 16px;
    font-weight: 500;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .topic-list {
        grid-template-columns: 1fr;
        max-height: 400px;
    }

    .topic-select-btn {
        opacity: 1;
    }
}

/* AI评分纠错详情样式 */
.correction-item {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid #9333ea;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.correction-item:last-child {
    margin-bottom: 0;
}

.correction-original,
.correction-corrected,
.correction-reason {
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.6;
}

.correction-item:last-child {
    margin-bottom: 0;
}

.correction-label {
    font-weight: 500;
    color: #666;
    margin-right: 6px;
}

.correction-original {
    color: #dc3545;
}

.correction-corrected {
    color: #28a745;
}

.correction-reason {
    color: #333;
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
}

.essay-score-compact {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
}

/* ==================== 用户协议复选框样式 ==================== */
.terms-checkbox {
    margin-top: 20px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.checkbox-container:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.02);
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    flex: 1;
}

.terms-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed #667eea;
    transition: var(--transition);
}

.terms-link:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

/* ==================== 条款页面样式 ==================== */
.terms-container {
    max-width: 900px;
    margin: 0 auto;
}

.terms-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
}

.terms-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.terms-header i {
    font-size: 48px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.terms-header h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

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

.terms-content {
    line-height: 1.8;
}

.terms-section {
    margin-bottom: 30px;
}

.terms-section h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.terms-section h3 i {
    color: #667eea;
    font-size: 18px;
}

.terms-section p {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.terms-section ul {
    margin-left: 25px;
    color: var(--text-secondary);
}

.terms-section li {
    margin-bottom: 8px;
}

.terms-section .sub-list {
    margin-top: 8px;
    margin-left: 20px;
}

.terms-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

.terms-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.terms-intro {
    background: rgba(102, 126, 234, 0.05);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 4px solid #667eea;
}

.terms-intro p {
    margin-bottom: 10px;
    line-height: 1.8;
}

.terms-intro p:last-child {
    margin-bottom: 0;
}

.terms-section h4 {
    font-size: 16px;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.highlight-box {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    border: 2px solid #f56565;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.highlight-box h5 {
    color: #c53030;
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.highlight-box h5 i {
    color: #f56565;
}

.highlight-box ul {
    margin-left: 20px;
}

.highlight-box li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.highlight-box li ul {
    margin-top: 8px;
    margin-left: 20px;
}

.highlight-box strong {
    color: #c53030;
}

@media (max-width: 768px) {
    .terms-card {
        padding: 20px;
    }

    .terms-section h3 {
        font-size: 18px;
    }

    .terms-section h4 {
        font-size: 15px;
    }

    .highlight-box {
        padding: 15px;
    }
}

/* ==================== 教师管理面板样式 ==================== */
.teacher-panel-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.teacher-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.teacher-panel-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.teacher-panel-info h2 {
    font-size: 1.8rem;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.teacher-panel-info span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.teacher-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.teacher-tab {
    padding: 12px 24px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    color: var(--text-secondary);
}

.teacher-tab:hover {
    border-color: #667eea;
    color: #667eea;
}

.teacher-tab.active {
    border-color: transparent;
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.teacher-tab-content {
    display: none;
}

.teacher-tab-content.active {
    display: block;
}

.teacher-form-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.teacher-form-card h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.teacher-actions-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.teacher-list-container {
    margin-top: 20px;
}

.teacher-list-item {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.teacher-list-item:hover {
    border-color: #667eea;
    box-shadow: var(--shadow-md);
}

.teacher-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 15px;
}

.teacher-item-title {
    flex: 1;
}

.teacher-item-title h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.teacher-item-title h4 small {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: normal;
}

.teacher-item-meta {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.teacher-item-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.teacher-item-desc {
    color: var(--text-secondary);
    margin: 10px 0;
    line-height: 1.6;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.teacher-item-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 教师评分模态框样式 */
.grading-modal-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.grading-modal-content .essay-detail-section {
    margin-bottom: 0;
}

.grading-modal-content .essay-detail-content {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* 按钮样式 */
.btn-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.btn-ai {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.btn-ai:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.4);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.9rem;
}

/* 徽章样式 */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-info {
    background: #cce5ff;
    color: #004085;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 5px;
}

/* 错误状态样式 */
.error-state {
    text-align: center;
    padding: 40px;
    color: #dc3545;
}

.error-state i {
    font-size: 48px;
    margin-bottom: 15px;
}

.error-state span {
    font-size: 1rem;
}

/* 加载占位符样式 */
.loading-placeholder {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading-placeholder i {
    font-size: 32px;
    margin-bottom: 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-placeholder span {
    font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .teacher-panel-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .teacher-panel-info {
        flex-direction: column;
    }

    .teacher-item-header {
        flex-direction: column;
    }

    .teacher-item-actions {
        flex-direction: row;
        width: 100%;
    }

    .teacher-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .teacher-tabs {
        justify-content: center;
    }
}
