/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #343a40;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px;
}

/* 标题样式 */
h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 40px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 1px;
}

h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 500;
}

h4 {
    color: #6c757d;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 500;
}

/* 表单样式 */
form {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    transition: box-shadow 0.3s ease;
}

form:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea {
    resize: vertical;
    min-height: 150px;
}

/* 按钮样式 */
button {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    margin-right: 10px;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

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

.btn-danger:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

/* 消息提示 */
.message {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 表格样式 */
.table-container {
    margin-bottom: 30px;
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.data-table thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.data-table th,
.data-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table tr.even {
    background-color: #f9f9f9;
}

.data-table tr.odd {
    background-color: #ffffff;
}

.data-table tr:hover {
    background-color: #f0f8ff !important;
    transition: background-color 0.3s ease;
}

.data-table .info-column {
    max-width: 400px;
    word-break: break-all;
}

.data-table .action-buttons {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

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

/* 批量操作按钮 */
.batch-actions {
    margin-bottom: 20px;
}

/* API文档样式 */
.api-doc {
    background-color: #f8f9fa;
    padding: 24px;
    border-radius: 12px;
    margin-top: 30px;
    border: 1px solid #e9ecef;
}

.api-doc h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 600;
}

.api-doc pre {
    background-color: #e9ecef;
    padding: 18px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin: 15px 0;
    line-height: 1.5;
}

.api-doc code {
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    form {
        padding: 24px;
    }

    table {
        font-size: 14px;
    }

    th,
    td {
        padding: 12px 14px;
    }

    button {
        padding: 10px 20px;
        font-size: 13px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 30px;
    }
}

/* 复选框样式 */
.checkbox {
    margin-right: 10px;
    cursor: pointer;
    transform: scale(1.1);
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 8px;
}

/* 搜索框样式 */
.search-container {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.search-container input {
    flex: 1;
    min-width: 200px;
}

/* 文件上传样式 */
.file-upload {
    margin: 30px 0;
    padding: 30px;
    border: 2px dashed #ced4da;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.file-upload:hover {
    border-color: #3498db;
    background-color: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.1);
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload label {
    display: block;
    cursor: pointer;
    color: #3498db;
    font-weight: 500;
    margin-bottom: 15px;
}

.file-upload button {
    margin-top: 10px;
}

/* 分页样式 */
.pagination {
    margin-top: 30px;
    text-align: center;
}

.pagination-info {
    margin-bottom: 15px;
    font-size: 14px;
    color: #6c757d;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pagination-controls a {
    padding: 8px 14px;
    background-color: #f8f9fa;
    color: #495057;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.pagination-controls a:hover {
    background-color: #e9ecef;
    transform: translateY(-1px);
}

.pagination-controls .active {
    background-color: #3498db;
    color: white;
}

/* 选择框样式 */
select {
    padding: 10px 14px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 一键删除区域样式 */
.delete-section {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.delete-section h4 {
    margin-bottom: 15px;
    color: #495057;
}

.delete-section button {
    margin-right: 10px;
    margin-bottom: 10px;
}

/* 表格为空时的样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 16px;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(52, 152, 219, 0.3);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

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