/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 登录页面 */
#loginPage {
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3cc51f 0%, #2ea814 100%);
}

#loginPage.active {
    display: flex;
}

.login-container {
    background: white;
    border-radius: 20px;
    padding: 60px 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 32px;
    color: #333;
    margin-bottom: 10px;
}

.login-header p {
    font-size: 16px;
    color: #666;
}

.login-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    height: 45px;
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #3cc51f;
}

.login-tip {
    text-align: center;
    font-size: 12px;
    color: #999;
}

.login-tip p {
    margin-bottom: 5px;
}

/* 主页面布局 */
#mainPage {
    min-height: 100vh;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    display: none;
}

#mainPage.active {
    display: flex;
}

/* 顶部导航栏 */
.header {
    background: linear-gradient(135deg, #3cc51f 0%, #2ea814 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h2 {
    font-size: 24px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-name {
    font-size: 16px;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 主内容区布局 */
.main-content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 70px);
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    min-height: calc(100vh - 70px);
}

.nav-menu {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 30px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #f5f5f5;
}

.nav-item.active {
    background: #f0f9ff;
    color: #3cc51f;
    border-left-color: #3cc51f;
}

.nav-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 16px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f5f5f5;
}

.content-page {
    display: none;
}

.content-page.active {
    display: block;
}

.page-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.stat-value {
    font-size: 48px;
    font-weight: bold;
    color: #3cc51f;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 16px;
    color: #666;
}

/* 标签栏 */
.tab-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: #f5f5f5;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #e9e9e9;
}

.tab-btn.active {
    background: #3cc51f;
    color: white;
}

/* 表格 */
.table-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #e9ecef;
    font-size: 14px;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.select-column {
    width: 80px;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
    user-select: none;
}

.select-all-label input {
    width: 16px;
    height: 16px;
}

.order-select-checkbox {
    width: 16px;
    height: 16px;
}

.order-row-selected {
    background-color: #f0f9ff;
}

.order-batch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 15px;
    padding: 12px 20px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.batch-summary {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.batch-status-select {
    width: 160px;
}

.status-control {
    margin-top: 8px;
}

.status-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.status-select:focus {
    outline: none;
    border-color: #3cc51f;
    box-shadow: 0 0 0 2px rgba(60, 197, 31, 0.15);
}

.status-select.is-loading {
    opacity: 0.6;
    cursor: progress;
}

.btn-primary.is-disabled,
.btn-primary:disabled {
    background: #c8e8d0;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.8;
}

.btn-primary.is-loading {
    position: relative;
    cursor: progress;
    opacity: 0.8;
}

.btn-primary.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 按钮 */
.btn-primary {
    background: linear-gradient(135deg, #3cc51f 0%, #2ea814 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.3s;
    box-shadow: 0 2px 8px rgba(60, 197, 31, 0.3);
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-danger {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.btn-success {
    background: #3cc51f;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

/* 配置列表 */
.config-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.config-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.config-list {
    margin-bottom: 20px;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.config-item-text {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.config-item-delete {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.config-input-group {
    display: flex;
    gap: 10px;
}

.config-input-group input {
    flex: 1;
    height: 40px;
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.config-notice {
    margin-top: 15px;
}

.config-textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.config-textarea:focus {
    outline: none;
    border-color: #3cc51f;
}

/* 内容管理 */
.content-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.content-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.banner-list, .recommend-list {
    margin-bottom: 20px;
}

.banner-item, .recommend-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.banner-item img {
    width: 200px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
}

.recommend-item {
    justify-content: space-between;
}

.recommend-item-text {
    flex: 1;
}

.recommend-item-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.recommend-item-desc {
    font-size: 12px;
    color: #666;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.filter-select,
.filter-input {
    flex: 1 1 160px;
    min-width: 160px;
    height: 40px;
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.filter-input {
    padding-left: 40px;
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23999" class="bi bi-search" viewBox="0 0 16 16"%3E%3Cpath d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z"/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 16px 16px;
}

.filter-datetime {
    background-image: none;
    padding-left: 12px;
    padding-right: 12px;
}

.filter-bar .btn-primary {
    flex: 0 0 auto;
    height: 40px;
    padding: 0 20px;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.status-processing {
    background: #d1ecf1;
    color: #0c5460;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 8px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14px;
}

.table-subtext {
    display: block;
    font-size: 12px;
    color: #999;
}

.table-remark {
    max-width: 220px;
    white-space: pre-wrap;
    word-break: break-word;
    color: #555;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        min-height: auto;
    }
    
    .nav-menu {
        display: flex;
        overflow-x: auto;
        padding: 10px 0;
    }
    
    .nav-item {
        white-space: nowrap;
        padding: 10px 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
}

