/**
 * 前台页面公共基础样式 - 无皮肤特定样式
 * 版本：1.0.0
 * 包含：重置样式、布局、通用组件等
 */

/* ==================== 全局重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b56cc);
}

/* ==================== 通用按钮样式 ==================== */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.btn-primary {
    color: #fff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #fff !important;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    transform: scale(1.005);
}

/* ==================== 搜索框样式 ==================== */
.search-section {
    margin-bottom: 30px;
}

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

.search-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.search-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-label {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.search-select,
.search-input {
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    min-width: 150px;
}

.search-select:focus,
.search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.search-select option {
    background: #fff;
    color: #333;
}

.btn-search,
.btn-reset {
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-rules {
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

/* ==================== 列表工具栏 ==================== */
.list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.list-toolbar h2 {
    font-size: 24px;
    font-weight: 700;
}

.add-btn {
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

/* ==================== 分页样式 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.page-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.page-btn.active {
    font-weight: 700;
}

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

.pagination-info {
    font-size: 14px;
    font-weight: 600;
    margin: 0 10px;
}

/* ==================== 弹窗样式 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    padding: 0;
}

.close-btn:hover {
    color: #333;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

/* ==================== 图片预览 ==================== */
.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-preview-item:hover img {
    transform: scale(1.1);
}

.image-preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.8);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
}

/* ==================== 状态标签 ==================== */
.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
}

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

.action-btn {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.action-btn:hover {
    transform: scale(1.05);
}

/* ==================== 加载动画 ==================== */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    font-size: 16px;
    font-weight: 600;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.empty-state-desc {
    font-size: 14px;
    opacity: 0.7;
}

/* ==================== 响应式表格 ==================== */
@media (max-width: 768px) {
    .table-container {
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
        font-size: 13px;
    }

    th, td {
        padding: 12px 10px;
        white-space: nowrap;
    }

    .action-buttons {
        gap: 6px;
    }

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

    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }

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

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

    .search-left {
        flex-direction: column;
        gap: 15px;
    }

    .search-group {
        width: 100%;
    }

    .search-select,
    .search-input {
        min-width: 100%;
    }

    .btn-search,
    .btn-reset,
    .btn-rules {
        width: 100%;
    }
}
