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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* 头部 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

header .subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* 标签页 */
.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 16px 12px;
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #e0e0e0;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    font-weight: bold;
    border-bottom: 3px solid #667eea;
}

.tab-content {
    display: none;
    padding: 24px;
}

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

/* 工具栏 */
.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.student-count, .comment-count {
    margin-left: auto;
    color: #666;
    font-size: 14px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: #ff5252;
    color: white;
}

.btn-danger:hover {
    background: #ff1744;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

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

/* 标签库样式 */
.tag-library {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tag-category {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e0e0e0;
}

.tag-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tag-category-title {
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag-category-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-block;
}

.tag-category-actions {
    display: flex;
    gap: 8px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tag-item {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tag-item:hover {
    transform: scale(1.05);
}

.tag-item.special {
    background: #F44336;
    color: white;
}

.tag-item .tag-delete {
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
}

.tag-item:hover .tag-delete {
    opacity: 1;
}

.tag-add {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    background: white;
    border: 1px dashed #999;
    color: #666;
    transition: all 0.2s;
}

.tag-add:hover {
    border-color: #667eea;
    color: #667eea;
}

/* 表格样式 */
.student-list {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

tr:hover {
    background: #f9f9f9;
}

td .tag-mini {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin: 2px;
    white-space: nowrap;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    margin: 0;
}

.form-row {
    display: flex;
    gap: 16px;
}

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

.required {
    color: #ff5252;
}

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

/* 设置面板 */
.settings-panel {
    max-width: 800px;
}

.settings-panel h3 {
    margin: 20px 0 12px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

/* 标签选择区域 */
.tag-select-area {
    margin: 16px 0;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 12px;
}

.tag-select-group {
    margin-bottom: 16px;
}

.tag-select-label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tag-select-label .color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.tag-select-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-select-item {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.tag-select-item:hover {
    transform: scale(1.05);
}

.tag-select-item.selected {
    border-color: #333;
    font-weight: bold;
}

/* 进度条 */
.progress-area {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.progress-bar {
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
    width: 0%;
}

.current-student {
    font-size: 14px;
    color: #667eea;
    font-weight: 500;
}

/* 评语卡片 */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
}

.comment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid #667eea;
}

.comment-card-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-card-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 8px;
    align-items: center;
}

.comment-card-content {
    font-size: 14px;
    line-height: 1.8;
    color: #444;
    text-indent: 2em;
    margin-bottom: 12px;
}

.comment-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 评语筛选 */
.comment-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.comment-filters select,
.comment-filters input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.comment-filters input {
    flex: 1;
    max-width: 300px;
}

/* 打印设置 */
.print-settings {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.print-settings h3 {
    margin-bottom: 16px;
}

.card-style-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.card-style-option {
    cursor: pointer;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.card-style-option:hover {
    background: #e0e0e0;
}

.card-style-option.active {
    border-color: #667eea;
    background: #e8eaf6;
}

.card-style-preview {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 4px;
}

.card-style-option span {
    font-size: 12px;
    color: #666;
}

/* 打印预览 */
.print-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.print-card-wrapper {
    position: relative;
}

.print-card-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
}

/* 卡片预览样式 */
.comment-card-preview {
    background: white;
    border-radius: 12px;
    padding: 24px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-decoration {
    text-align: center;
    font-size: 18px;
    color: #FF9800;
}

.card-student-name {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    margin: 12px 0;
    color: #333;
}

.card-content {
    font-size: 14px;
    line-height: 1.8;
    color: #444;
    text-indent: 2em;
    flex: 1;
    margin: 16px 0;
}

.card-teacher-sign {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 12px;
}

/* 卡片样式变体 */
.card-style-style1 .comment-card-preview {
    border: 1px solid #2196F3;
    background: #f5f9ff;
}

.card-style-style2 .comment-card-preview {
    border: 2px solid #FF9800;
    background: #fff8e1;
}

.card-style-style3 .comment-card-preview {
    border: 2px dashed #4CAF50;
    background: #e8f5e9;
}

.card-style-style4 .comment-card-preview {
    border: 1px solid #333;
    background: #ffffff;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-large {
    max-width: 800px;
}

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

.modal-header h3 {
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-content form,
.modal-content .upload-area {
    padding: 20px;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f9f9ff;
}

.upload-placeholder p {
    margin-bottom: 8px;
    color: #666;
}

.upload-placeholder .hint {
    font-size: 12px;
    color: #999;
}

/* 导入预览 */
.import-preview {
    padding: 20px;
}

.import-preview h4 {
    margin-bottom: 12px;
}

.preview-table {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.preview-table table {
    font-size: 12px;
}

.preview-table th,
.preview-table td {
    padding: 8px;
}

.import-count {
    margin-top: 12px;
    color: #666;
}

/* 预览内容 */
.preview-content {
    padding: 20px;
}

/* 响应式 */
@media (max-width: 768px) {
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .tab-btn {
        min-width: 80px;
        padding: 12px 8px;
        font-size: 12px;
    }

    .form-row {
        flex-direction: column;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar .btn {
        width: 100%;
    }

    .student-count, .comment-count {
        margin-left: 0;
        text-align: center;
    }

    .comment-filters {
        flex-direction: column;
    }

    .comment-filters input {
        max-width: 100%;
    }

    .print-preview {
        grid-template-columns: 1fr;
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* 学生类型标签 */
.student-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.student-type-badge.优等生 {
    background: #E3F2FD;
    color: #1976D2;
}

.student-type-badge.中等生 {
    background: #E8F5E9;
    color: #388E3C;
}

.student-type-badge.后进生 {
    background: #FFF3E0;
    color: #F57C00;
}

.student-type-badge.特长生 {
    background: #F3E5F5;
    color: #7B1FA2;
}

/* 拖拽样式 */
.tag-item.dragging {
    opacity: 0.5;
}

.tag-item.drag-over {
    border: 2px dashed #667eea;
}

/* 设置区块样式 */
.settings-section {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.settings-section h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

/* 字数选项样式 */
.word-count-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
}

.inline-input {
    width: 80px !important;
    padding: 6px 8px !important;
    font-size: 13px !important;
}

/* 自定义输入样式 */
.select-with-custom {
    display: flex;
    gap: 8px;
    align-items: center;
}

.select-with-custom select {
    flex: 1;
}

.custom-input {
    flex: 1;
}

/* 设置面板 */
.settings-panel {
    max-width: 900px;
}

/* 选项组样式 */
.option-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.option-item {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.option-item:hover {
    border-color: #667eea;
    background: #f5f5ff;
}

.option-item.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

/* 提示文字 */
.form-hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* 分组标题 */
.section-title {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: #667eea;
    border-radius: 2px;
}

/* 生成评语页面布局 */
.generate-layout {
    display: flex;
    gap: 20px;
}

.generate-students {
    width: 280px;
    flex-shrink: 0;
    background: #f9f9f9;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.generate-students-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.generate-students-header h3 {
    font-size: 14px;
    margin: 0;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.generate-student-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    padding: 8px;
}

.generate-student-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.generate-student-item:hover {
    background: #e0e0e0;
}

.generate-student-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.generate-student-item .student-name {
    flex: 1;
    font-size: 14px;
}

.generate-student-item.has-comment {
    opacity: 0.7;
}

.comment-badge {
    font-size: 11px;
    color: #4CAF50;
    background: #e8f5e9;
    padding: 2px 6px;
    border-radius: 10px;
}

.generate-students-footer {
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.generate-main {
    flex: 1;
}

/* 响应式 */
@media (max-width: 768px) {
    .generate-layout {
        flex-direction: column;
    }

    .generate-students {
        width: 100%;
    }

    .generate-student-list {
        max-height: 200px;
    }
}
