/* 通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background: #f5f5f5;
}

button, input, select, textarea {
    font-family: inherit;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-warning {
    background: #f0ad4e;
    color: white;
}

.btn-warning:hover {
    background: #ec971f;
}

.btn-warning:disabled {
    background: #f0ad4e;
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 下拉框样式优化 */
select {
    appearance: none;
    -webkit-appearance: none;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
    background-size: 12px;
    padding-right: 30px;
    cursor: pointer;
}

select:hover {
    border-color: #667eea;
}

select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 850px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

/* PDF预览模态框特殊样式 */
#pdfModal .modal-content {
    padding: 0;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content .close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    padding: 5px 8px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 10;
    display: block;
}

.modal-content .close:hover {
    color: #000;
    background-color: #f0f0f0;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table thead {
    background: #f8f9fa;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    font-weight: 600;
    color: #333;
}

table tbody tr:hover {
    background: #f8f9fa;
}

table button {
    margin: 0 4px;
    font-size: 12px;
    padding: 4px 8px;
}

/* 消息和提示 */
.message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.empty-message,
.developing-message {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 16px;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    z-index: 9999;
    border: 1px solid #e0e0e0;
    padding-top: 4px;
}

.dropdown-content::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
}

.dropdown-content a:hover {
    background: #f1f3f5;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* 按钮下拉菜单样式 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    overflow: visible;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    overflow: visible;
}

.dropdown-btn-wrapper {
    position: relative;
    display: inline-block;
    overflow: visible;
}

.dropdown-btn-wrapper .dropdown-menu {
    display: none !important;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    z-index: 9999;
    margin-top: 4px;
    border: 1px solid #e0e0e0;
}

.dropdown-btn-wrapper .dropdown-menu.show {
    display: block !important;
}

.dropdown-btn-wrapper .dropdown-menu a {
    color: #333;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-btn-wrapper .dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-btn-wrapper .dropdown-menu a:hover {
    background: #f5f5f5;
}

/* 导出状态表格 */
.export-status-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.export-status-table th,
.export-status-table td {
    padding: 14px 16px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.export-status-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.export-status-table tbody tr:hover {
    background: #f8f9fa;
}

.export-status-table .module-name {
    text-align: left;
    font-weight: 500;
    color: #333;
}

.export-status-table .status-complete {
    color: #28a745;
    font-weight: 500;
}

.export-status-table .status-incomplete {
    color: #dc3545;
}

.export-status-table .action-btn {
    display: inline-block;
    padding: 6px 12px;
    margin: 2px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    color: white;
    transition: background 0.2s;
}

.export-status-table .action-btn:hover {
    opacity: 0.9;
}

.export-status-table .btn-preview {
    background: #17a2b8;
}

.export-status-table .btn-pdf {
    background: #dc3545;
}

.export-status-table .btn-excel {
    background: #28a745;
}

.export-status-table .btn-docx {
    background: #667eea;
}

.export-status-table .action-disabled {
    background: #ccc;
    cursor: not-allowed;
    pointer-events: none;
}

/* 课次表格样式 */
.sessions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.sessions-table th,
.sessions-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.sessions-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.sessions-table tbody tr:hover {
    background: #f8f9fa;
}

.sessions-table .btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    margin: 0 2px;
}

.sessions-table input[type="date"] {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.sessions-table input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
}

/* 小按钮样式 */
.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-info:disabled {
    background: #ccc;
    cursor: not-allowed;
}
