
:root {
    /* 主要颜色变量 */
    --color-primary: #0d6efd;
    --color-primary-dark: #0a58ca;
    --color-danger: #dc3545;
    --color-success: #198754;
    --color-warning: #ffc107;

    /* 背景色 */
    --bg-dark: #1f1e1e;
    --bg-gray: #6d6666;
    --bg-light: #fafafa;
    --bg-light-hover: #f0f0f0;
    --bg-nav: #f8f9fa;
    --bg-nav-hover: #e9ecef;
    --bg-page: #f5f5f5;

    /* 文字颜色 */
    --text-light: #ffffff;
    --text-dark: #333333;
    --text-muted: #999999;
    --text-nav: #495057;

    /* 边框颜色 */
    --border-light: #e0e0e0;
    --border-lighter: #e8e8e8;

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-dark);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 顶部栏 */
.header {
    height: 60px;
    padding: 0 24px;
    background-color: var(--bg-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

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

.back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}

.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-light);
}

.profileButton {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: var(--bg-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    border: 1px solid var(--border-lighter);
    transition: background-color 0.2s ease;
}

.profileButton:hover {
    background-color: var(--bg-light-hover);
}

.profileButton span {
    font-size: 14px;
    color: var(--text-dark);
}

/* 主体容器 */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 0;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-dark);
}

.tab-btn.active {
    background: var(--bg-dark);
    color: var(--text-light);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 卡片 */
.card {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-lighter);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-lighter);
}

/* 表单 */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.required {
    color: var(--color-danger);
    margin-left: 2px;
}

.form-group input,
.form-group select {
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-light);
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    background: var(--text-light);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    color: var(--text-dark);
    box-shadow:
            4px 4px 12px rgba(0, 0, 0, 0.1),
            -4px -4px 12px rgba(255, 255, 255, 0.9),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.btn-primary:hover {
    background: linear-gradient(145deg, #f0f0f0, #dcdcdc);
    box-shadow:
            2px 2px 8px rgba(0, 0, 0, 0.12),
            -2px -2px 8px rgba(255, 255, 255, 0.95),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateY(1px);
}

.btn-primary:active {
    background: linear-gradient(145deg, #e0e0e0, #d0d0d0);
    box-shadow:
            inset 2px 2px 6px rgba(0, 0, 0, 0.1),
            inset -2px -2px 6px rgba(255, 255, 255, 0.5);
    transform: translateY(2px);
}

.btn-secondary {
    background: var(--bg-nav);
    color: var(--text-nav);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-nav-hover);
}

.btn-danger {
    background: var(--color-danger);
    color: var(--text-light);
}

.btn-danger:hover {
    background: #c82333;
}

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

/* 表格 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-lighter);
    font-size: 14px;
}

th {
    font-weight: 600;
    color: var(--text-nav);
    background: var(--bg-nav);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    color: var(--text-dark);
}

tr:hover td {
    background-color: var(--bg-nav);
}

.actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 16px;
}

.btn-icon:hover {
    background: var(--bg-nav-hover);
    color: var(--color-danger);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px 0;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-lighter);
}

.filter-search {
    display: flex;
    gap: 12px;
}

.search-field {
    flex: 1;
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.search-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.filter-selects {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-selects select {
    height: 40px;
    padding: 0 36px 0 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-light);
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 120px;
}

.filter-selects select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    color: var(--text-nav);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-nav-hover);
}

.pagination button.active {
    background: var(--bg-dark);
    color: var(--text-light);
    border-color: var(--bg-dark);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 选项管理 */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.option-add-form {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.option-add-form input {
    flex: 1;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.option-add-form input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.option-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.option-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-lighter);
    transition: background-color 0.2s ease;
}

.option-list li:last-child {
    border-bottom: none;
}

.option-list li:hover {
    background-color: var(--bg-nav);
}

.option-list li span {
    font-size: 14px;
    color: var(--text-dark);
}

.option-list li .delete-option {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
    opacity: 0;
}

.option-list li:hover .delete-option {
    opacity: 1;
}

.option-list li .delete-option:hover {
    background: #fee2e2;
    color: var(--color-danger);
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 400px;
    max-width: 90%;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform 0.25s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.modal-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 14px 24px;
    background: var(--bg-dark);
    color: var(--text-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--color-success);
}

.toast.error {
    background: var(--color-danger);
}

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

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .option-grid {
        grid-template-columns: 1fr;
    }

    th, td {
        padding: 10px 12px;
        font-size: 13px;
    }
}
