* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* 登录页面 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 400px;
}

.login-box h2 {
    margin-bottom: 30px;
    text-align: center;
    color: #333;
}

/* 备案信息 */
.beian-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
    text-align: center;
}

.beian-info a {
    color: #999;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.3s;
}

.beian-info a:hover {
    color: #1890ff;
    text-decoration: underline;
}

/* 主界面 */
.main-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    background: #1890ff;
    color: white;
    padding: 0 30px;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 20px;
    font-weight: 500;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 200px;
    background: white;
    border-right: 1px solid #e8e8e8;
}

.sidebar nav {
    padding: 20px 0;
}

.sidebar nav a {
    display: block;
    padding: 12px 30px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar nav a:hover {
    background: #f0f0f0;
    color: #1890ff;
}

.sidebar nav a.active {
    background: #e6f7ff;
    color: #1890ff;
    border-right: 3px solid #1890ff;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 500;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1890ff;
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #1890ff;
    color: white;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-secondary {
    background: #52c41a;
    color: white;
}

.btn-secondary:hover {
    background: #73d13d;
}

.btn-danger {
    background: #ff4d4f;
    color: white;
}

.btn-danger:hover {
    background: #ff7875;
}

.btn-warning {
    background: #faad14;
    color: white;
}

.btn-warning:hover {
    background: #ffc53d;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* 紧凑按钮组 */
.btn-group-compact {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.btn-group-compact .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.btn:not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.btn-warning) {
    background: white;
    border: 1px solid #d9d9d9;
    color: #333;
}

.btn:not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.btn-warning):hover {
    border-color: #1890ff;
    color: #1890ff;
}

/* 课程卡片 */
.course-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.course-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.course-card h3 {
    margin-bottom: 10px;
    color: #1890ff;
}

.course-card p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.course-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #999;
}

.course-actions {
    display: flex;
    gap: 10px;
}

/* 数据表格 */
.data-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
}

.data-table thead {
    background: #fafafa;
}

.data-table tbody tr {
    border-top: 1px solid #f0f0f0;
}

.data-table tbody tr:hover {
    background: #f5f5f5;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 800px;
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* 题目编辑器 */
.questions-editor {
    margin-bottom: 20px;
}

.question-item {
    background: #fafafa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.question-header h4 {
    font-size: 16px;
    color: #1890ff;
}

.options-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.option-item {
    display: flex;
    flex-direction: column;
}

.option-item label {
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 13px;
    color: #666;
}

/* 错误信息 */
.error-msg {
    color: #ff4d4f;
    margin-top: 10px;
    font-size: 14px;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.badge-warning {
    background: #fffbe6;
    color: #faad14;
    border: 1px solid #ffe58f;
}

.text-muted {
    color: #999;
}

.help-text {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

/* 签署记录网格 */
.records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.record-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.record-header h3 {
    margin: 0;
    color: #1890ff;
    font-size: 18px;
}

.record-date {
    color: #999;
    font-size: 14px;
}

.record-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.record-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: center;
}

.record-actions button {
    width: 100%;
    max-width: 300px;
}

/* 签名缩略图 */
.signature-thumbnail {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
}

.signature-thumbnail img {
    max-width: 150px;
    max-height: 50px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    padding: 4px;
}

.signature-thumbnail img:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-color: #1890ff;
}

.no-signature-text {
    color: #999;
    font-size: 12px;
}

/* 签署记录详情弹窗 */
.record-detail-modal {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.detail-section:last-of-type {
    border-bottom: none;
}

.detail-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.signature-detail-img,
.document-detail-img {
    text-align: center;
    padding: 15px;
    background: #fafafa;
    border-radius: 8px;
}

.signature-detail-img img {
    max-width: 400px;
    max-height: 150px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
    background: white;
    padding: 10px;
}

.signature-detail-img img:hover {
    transform: scale(1.05);
}

.document-detail-img img {
    max-width: 100%;
    max-height: 500px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.document-detail-img img:hover {
    transform: scale(1.02);
}

.detail-info {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.detail-info p {
    margin: 8px 0;
    color: #666;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
    background: #fafafa;
    border-radius: 8px;
}

.page-header-info {
    margin-left: 20px;
    color: #666;
    font-size: 14px;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 统计信息栏 */
.statistics-bar {
    display: flex;
    gap: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    font-weight: 500;
}

.stat-value {
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-signed {
    color: #52c41a;
}

.stat-rate {
    color: #ffd700;
}

.document-preview h4,
.signature-preview h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
}

.signed-doc-preview img,
.signature-img img {
    max-width: 100%;
    border: 1px solid #eee;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.signed-doc-preview img:hover,
.signature-img img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.no-document,
.no-signature {
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 4px;
    color: #999;
}

/* 大图查看 */
.large-image-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}

.large-image-container img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
}

.close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    transition: all 0.3s;
}

.close-btn:hover {
    background: #ff4d4f;
    color: white;
    transform: rotate(90deg);
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #e6f7e6;
    color: #52c41a;
}

.badge-secondary {
    background: #f0f0f0;
    color: #999;
}

/* 空消息 */
.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* 签名位置设置模态框 */
.signature-position-modal {
    z-index: 10000;
}

.position-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #f0f0f0;
}

.position-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.position-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* 页面选择器 */
.page-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-btn {
    padding: 8px 16px;
    border: 2px solid #d9d9d9;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.page-btn.active {
    background: #1890ff;
    color: white;
    border-color: #1890ff;
}

/* 预览容器 */
.preview-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.preview-image {
    width: 100%;
    display: block;
}

/* 签名框 */
.signature-box {
    position: absolute;
    border: 2px solid #1890ff;
    background: rgba(24, 144, 255, 0.08);
    cursor: move;
    user-select: none;
    transition: all 0.2s;
    box-shadow: 0 0 8px rgba(24, 144, 255, 0.3);
}

.signature-box:hover {
    background: rgba(24, 144, 255, 0.12);
    border-color: #40a9ff;
    box-shadow: 0 0 12px rgba(24, 144, 255, 0.5);
}

.signature-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #1890ff;
    font-weight: bold;
    font-size: 14px;
    pointer-events: none;
    text-shadow: 0 0 3px white;
}

.resize-handle {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 20px;
    height: 20px;
    background: #1890ff;
    border: 2px solid white;
    border-radius: 50%;
    cursor: nwse-resize;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.resize-handle:hover {
    background: #40a9ff;
    transform: scale(1.2);
}

/* 位置信息显示 */
.position-info {
    margin-top: 15px;
    text-align: center;
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
}

.position-info span {
    font-size: 14px;
    color: #666;
    font-family: monospace;
}

/* 底部操作栏 */
.position-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 20px 25px;
    border-top: 2px solid #f0f0f0;
    background: #fafafa;
}

.position-footer button {
    flex: 1;
    max-width: 200px;
}

/* 响应式 */
@media (max-width: 768px) {
    .records-grid {
        grid-template-columns: 1fr;
    }
    
    .record-card {
        padding: 15px;
    }
    
    .position-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .position-footer {
        flex-direction: column;
    }
    
    .position-footer button {
        max-width: none;
    }
}

/* Excel导入相关 */
.import-instructions {
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.import-instructions p {
    margin: 5px 0;
}

.import-instructions ul {
    margin: 10px 0;
    padding-left: 25px;
}

.import-instructions li {
    margin: 5px 0;
}

.import-instructions .required {
    color: #dc2626;
    font-weight: bold;
}

.sample-table {
    width: 100%;
    margin-top: 10px;
    font-size: 12px;
    border-collapse: collapse;
}

.sample-table th,
.sample-table td {
    border: 1px solid #e5e7eb;
    padding: 8px;
    text-align: left;
}

.sample-table thead {
    background: #f3f4f6;
}

.import-result {
    margin-top: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
}

.import-result h4 {
    margin: 0 0 10px 0;
}

.import-result .success {
    color: #059669;
    font-weight: 500;
}

.import-result .error {
    color: #dc2626;
    font-weight: 500;
}

.error-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
}

.error-list ul {
    margin: 5px 0;
    padding-left: 20px;
}

.error-list li {
    margin: 3px 0;
    font-size: 13px;
}

/* 用户签署记录弹窗 */
.user-sign-records-modal {
    max-width: 800px;
    max-height: 90vh;
}

.records-summary {
    display: flex;
    gap: 30px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-item .label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.summary-item .value {
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.summary-item .value.signed {
    color: #52c41a;
}

.summary-item .value.unsigned {
    color: #faad14;
}

.records-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
    font-weight: 600;
}

.tab-btn:hover {
    color: #1890ff;
}

.records-list {
    max-height: 400px;
    overflow-y: auto;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.record-item:hover {
    border-color: #1890ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.1);
}

.record-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}

.record-meta {
    font-size: 13px;
    color: #999;
    margin: 0;
}

.record-actions {
    display: flex;
    gap: 8px;
}

.record-status {
    display: flex;
    align-items: center;
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #f0f9ff;
    color: #0284c7;
}

.badge-warning {
    background: #fef3c7;
    color: #f59e0b;
}

/* ==================== 公章功能样式 ==================== */

/* 公章上传区域 */
.seal-upload-section {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
}

.seal-preview-info {
    margin-top: 15px;
    padding: 15px;
    background: #e6f7ff;
    border-left: 4px solid #1890ff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.seal-preview-info p {
    margin: 0;
    color: #1890ff;
    font-weight: 500;
    flex: 1;
}

.seal-thumb {
    max-width: 80px;
    max-height: 80px;
    border: 2px solid #1890ff;
    border-radius: 50%;
    background: white;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
}

/* 公章框样式 */
.seal-box {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    cursor: move;
}

.seal-box:hover {
    opacity: 0.9;
}

.seal-box.dragging {
    opacity: 0.7;
}

.seal-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    border-radius: 50%;
}

.preview-section {
    margin-top: 20px;
}

/* 公章提示信息 */
.seal-upload-section .help-text {
    margin-top: 8px;
    color: #666;
    font-size: 13px;
    line-height: 1.6;
}

